If you have IE 8 installed and your ASP.Net project won’t stop on the breakpoints you’ve set they you probably need to read this article
You basically need to add an entry to your registry to stop process growth for tabs.
I’ve copied the steps required below
1) Open RegEdit
2) Browse to HKEY_LOCALMACHINE -> SOFTWARE -> Microsoft -> Internet Explorer -> Main
3) Add a dword under this key called TabProcGrowth
4) Set TabProcGrowth to 0
This operator allows you to supply an alternative value if the value being supplied is null. It only works on nullable datatypes but with a bit of googling came accross this article.
public int CurrentPage
{
get
{
return (int)(ViewState["_CurrentPage"] ?? 0);
}
set
{
this.ViewState["_CurrentPage"] = value;
}
}
Following code iterates through each entry in a dictory
For Each keyPair As KeyValuePair(Of String, Int32) In aDepot.PostcodeCounters
builder.Append("<tr><td>")
builder.Append(keyPair.Key)
builder.Append("</td><td align=""right"">")
builder.Append(keyPair.Value)
builder.Append("</td></tr>")
Next
In Visual Studio 2008 you’ve lost the abillity to click on the drop down in the code behind and see all the event signatures that are available but haven’t handled yet. To get the signature you are after without using the properites in the desinger you can type…
this.
As you hit the . all methods and events should appear, pick the event you after e.g. Load
Then add type += after the event name and press TAB TAB, the event is automatically generated. ASP.Net auto wires the events with the correct name and signature so you should be able to delete the line of code that binds the event.
Normally when you write a server control, .Net automatically wraps the output with a span and the Id of the control. Depending on your CSS this can cause rendering issues. You can use the following technique to prevent the span from being rendered.
public override void RenderBeginTag(HtmlTextWriter writer)
{
using (HtmlTextWriter blankOne = new HtmlTextWriter(new System.IO.StringWriter()))
{
base.RenderBeginTag(blankOne);
}
}
public override void RenderEndTag(HtmlTextWriter writer)
{
}
It basically writes out the open tag to a new HTML Writer and therefore is not part of the final rendered HTML
Use the TryParse method to determine if a value is numeric
int retNum;
if (Int32.TryParse(BookId, System.Globalization.NumberStyles.Any, System.Globalization.NumberFormatInfo.InvariantInfo, out retNum))
{
//Is numeric
}