Apr 06
If you have developed a .Net 4 website in Visual Studio 10 that that uses a client reportviewer control, then you are likely to run into problems with running reportviewer on the production server. Here’s the steps to get it running:
- Install ReportViewer 10 on your production machine. Go to Microsoft Download Center and search for “Microsoft Report Viewer 2010”
download and install to your production server
- publish website to production server
- on the development server go to
[drive]:\Program Files\Microsoft Visual Studio 10.0\ReportViewer\
and copy the following files to the “bin” folder of your live site:
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.WebForms.dll
- this is the tricky part, copying “Microsoft.ReportViewer.ProcessingObje
ctModel.dll”
- on your production server open a Command Prompt window, then cd to [drive]:\Windows
- then dir /s Microsoft.ReportViewer.ProcessingObjectModel.dll to find the dll
- cd to assembly\gac_msil\microsoft.reportviewer.processingobjectmodel
this path contained the 2 versions of the file:
10.0.0.0__b03f5f7f11d50a3a
9.0.0.0__b03f5f7f11d50a3a
since I’m using VS2010, I need the version 10
- copy 10.0.0.0__b03f5f7f11d50a3a [drive]:\[path]\bin
- you will now see “Microsoft.ReportViewer.ProcessingObjectModel.dll” in your website’s bin folder, you’re good to go
Jan 11
with a regular button, you can programmatically call the Button_Click by calling:
Button1_Click(Me, EventArgs.Empty);
However, with an ImageButton, you get an error if you use the above method. You need an extra line of code:
ImageClickEventArgs args = new ImageClickEventArgs(1, 1);
ImageButton1_Click(this, args);
Mar 03
Problem: create a file-download-list that you can filter by tag, category, or other criteria
Solution:
- create a library and upload your files to it
- categories and/or tag the files the way you want them to be filtered
- download the following sample code from the Telerik team:
http://www.sitefinity.com/ClientsFiles/143126_customdownloadlist.zip
(for more information on this download refer to Telerik’s forum)
- add the following customizations to the supplied sample in order to filter by tags or categories:
if (filterByTag)
{
tagFilter = new List<ITag>();
IList<ITag> alltags = this.manager.GetTags().OfType<ITag>().ToList();
foreach (Guid g in FromTags)
{
foreach (ITag t1 in alltags)
{
if (t1.ID.Equals(g)) { tagFilter.Add(t1); }
}
}
}
if (filterByCategory)
{
categoryFilter = new List<ICategory>();
IList<ICategory> allcats = this.manager.GetCategories().OfType<ICategory>().ToList();
foreach (Guid g in FromCategories)
{
foreach (ICategory c1 in allcats)
{
if (c1.ID.Equals(g)) { categoryFilter.Add(c1); }
}
}
}
now you have a custom download list that filters by Tags or Categories.
I have only tried this code on a Sitefinity 3.7 Standard site, I don’t know if it is compatible with other versions.
Mar 03
If you use the standard ASP.NET menu (or toolbar) in your web application, it works well in most browsers except for Safari & Chrome. In these 2 browsers, each menu item appears on a new line.
The fix I found was placing the following code in my MaterPage code-behind:
if (Request.UserAgent.IndexOf(“AppleWebKit”) > 0)
{
Request.Browser.Adapters.Clear();
}
If you are not using a Materpage:
protected void Page_PreInit(object sender, EventArgs e)
{
if (Request.UserAgent != null && Request.UserAgent.IndexOf(“AppleWebKit”, StringComparer.CurrentCultureIgnoreCase) > -1)
{
this.ClientTarget = “uplevel”;
}
}
The solution is adapted from this site (Thank you):
http://weblogs.asp.net/joshuajohnson/archive/2008/01/23/how-do-i-overcome-the-dreaded-safari-asp-net-menu-conundrum.aspx
Jan 04
In order to host a Silverlight application on IIS6 you will need to add a MIME type
- Open IIS, right-click and select properties for the Silverlight site.
- Select the tab for HTTP Headers
- Click on MIME Types
- Click New and add Extension= .xaml and Mime Type= application/xaml+xml
- Depending on the features used in your Silverlight app, you might also need to add 2 new types of
(.xap application/x-silverlight-app) and (.xbap application/x-ms-xbap)
Aug 12
if you have an UltraWebGrid with a TemplatedColumn, the TemplatedColumn has a checkbox or any other control. If you want to access the control inside that column here’s what you need to do:
- assuming you have a loop cycling through the rows
- Dim rw As UltraWebGrid.UltraGridRow = UltraWebGrid1.DisplayLayout.Rows(i)
- Dim cl As UltraWebGrid.UltraGridCell = rw.Cells.FromKey("myColumnName")
- Dim col As Infragistics.WebUI.UltraWebGrid.TemplatedColumn = cl.Column
- Dim ci As Infragistics.WebUI.UltraWebGrid.CellItem = col.CellItems(i)
- Dim chk As CheckBox = ci.FindControl("myCheckBoxID")
now you can access that checkbox and do whatever you want with it.
May 26
if your webpage submits a file for uploading, and the page returns an error on larger file sizes, then look for 2 attributes to modify in your web.config .
open you web.config file and seach for the following line:
<httpRuntime executionTimeout="480" maxRequestLength="7168"/>
executionTimeout is the time limit before the request timesout and you get an error, this figure is represented in seconds (480 = 8 minutes)
maxRequestLength is the file size represented in KB (1024 = 1MB, 7168 – 7MB)
for detailed info, go to: http://msdn.microsoft.com/en-us/library/e1f13641(VS.71).aspx
May 25
Access File:
”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Work\Tools\myaccessdb.mdb;”
SQL Server:
“user id=SqlLoginName;password=SqlPW;initial catalog=yourDBname;data source=YourServerName;Connect Timeout=30″
SQL – OLE DB:
Data Source=ServerIP; User ID=SqlLoginName;password=SqlPW;initial catalog=yourDBname
CSV File:
”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=”c:\tool\myfile.csv”;Extended Properties=”"text;HDR=No;FMT=Delimited”"”
ODBC link:
”DSN=myDB;UID=John;PWD=123;”
May 13
The scenario: you have a stored procedure in SQL and a typed dataset in Visual Studio that references the stored procedure. In your stored procedure, you create a temporary table and fill it with data and use it as output. When you go to create the typed dataset, it does not recognize the columns that the stored procedure returns.
Solution: in Visual Studio, create you typed dataset and use the stored procedure as a source (even if it doesn’t recognize the columns). After it is done, right clck the xsd file in Solution Explorer and click “View Code”. You should get an xml representation of your dataset. Here is where you create your columns manually. You need to add the column definitions in 2 places:
- Find “TableAdapter”, under it look for “Mappings”, inside mappings you will add a node for each column like:
<Mapping SourceColumn="CompanyName" DataSetColumn="CompanyName" />
- Find
<xs:element name="dsGetCompany"…..
<xs:element name="CompanyName" msprop:Generator_UserColumnName="CompanyName" ….
you will add “<xs: element….” for each column you want to add. I found the best way is to copy these nodes from similar columns from another dataset.
For more information
Recent Comments