I was wondering what's the best way to handle forms in asp.net when dealing with master pages.
The simple thing to do, and it hasn't caused me problems so far, is to just make one <from runat="server"> on the main master page and go from there. Not doing so causes problems when you try to create a seach bar at the top of the master page and then an input form on a child page, for example. But it just feels so ugly.
Although you should consider understanding the master pages first. They are used to create a similar layout across pages. So, a search box would definitely go in the master page. Unless you want to write the same HTML across pages, which would even break the DRY rule.
So, you must first check (and consider) where are going to show the HTML content. Search box, logo etc they would go in the master page. To be rendered on all pages, a content or snippet such as a form on contact page would only be on that page. So, putting that form in master page would not be a good act.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
Does anybody have any idea about this:-
I have several kinds offile(pdf,html,png) in my d: drive inside a folder . I want toopen these files on the browser using anchor tag orany hyperlink control but the url should not display the path like d://Somefolder/File it should be like Localhost:1234/Somefolder/file.
Can some one plz help me in referring a sample which can create a 64 bit webservice to call a 64 bit interop dll
I havetred to create a webserice using asp.net but by default service is targetting 32 bit only and while loading the interop dll it throwing exception as below,
"System.BadImageFormatException: Could not load file or assembly 'Interop.*****, Version=126.96.36.199, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."
OS: windows 2008 server 64 bit
IDE: VS 2010
I Was running a Fortify scan and I received the error (Poor Error Handling: Overly Broad Catch). Here is the code:
XmlSchemaSet schemas = new XmlSchemaSet();
XDocument xdoc = XDocument.Parse(xmlString);
//validates that an XMLDocument conforms to an XSD
xdoc.Validate(schemas, (o, e) =>
msg += e.Message + Environment.NewLine;
if (msg != "")
throw new Exception(msg);
catch (Exception e)
WriteErrorLog("Error in ValidateXml");
msg = e.Message;
return "Error - Document is invalid: " + msg;
Simple I thought. I just the "catch (Exception e)" to "catch (ArgumentOutOfRangeException e)". Now when I run the application it receive the follow error:
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
Does anyone know what the problem is?
I'm just taking a guest here,
But the e in exception is an object
And I think the message is an object as well.
So when passing e to a function, you have to pass it as an exception object
When writing the message in e, you have to extract the message text, or do something with the message object.
I am using gridviewfix in my project and using sorting number there is problem in sorting number.. for example It shows(1,10,100,1000) instead of (1,2,3,4,5..etc). Kindly update me anyone know this answer thanks in advance
If (sCIR.Length > 0) Then
For idx As Integer = 0 To sCIR.Length - 1
rs_DataRow = rs_Table.NewRow()
rs_DataRow(0) = sCIR(idx).FITEMNO
rs_DataRow(1) = sCIR(idx).FDESCRIPT
rs_DataRow(2) = sCIR(idx).FSHIPQTY
rs_DataRow(3) = sCIR(idx).FCOST
rs_DataRow(4) = sCIR(idx).FPRICE
rs_DataRow(5) = sCIR(idx).FAMOUNT
rs_DataRow(6) = sCIR(idx).FMARGIN_PERCENT
rs_DataRow(7) = sCIR(idx).FMARGIN_PROFIT
'Add up the total cost value
m_totalCost += sCIR(idx).FCOST * sCIR(idx).FSHIPQTY
'Add up the total price value
m_totalPrice += sCIR(idx).FPRICE * sCIR(idx).FSHIPQTY
'Calculate the average margin of all the items
'Add up the total margin value
m_totalMargin += sCIR(idx).FMARGIN_PROFIT
Last Visit: 31-Dec-99 19:00 Last Update: 4-Mar-21 0:19