|
Its possible. Put debugged in your code to check for NULL causing this exception.
modified 20-Sep-20 21:01pm.
|
|
|
|
|
|
Pls add your code what have you tried?
modified 20-Sep-20 21:01pm.
|
|
|
|
|
Hello All,
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.
Thoughts?
|
|
|
|
|
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 of file(pdf,html,png) in my d: drive inside a folder . I want to open these files on the browser using anchor tag or any hyperlink control but the url should not display the path like d://Somefolder/File it should be like Localhost:1234/Somefolder/file.
|
|
|
|
|
Hello All,
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=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format."
environemt:
OS: windows 2008 server 64 bit
IDE: VS 2010
Thanks in advance
|
|
|
|
|
|
I Was running a Fortify scan and I received the error (Poor Error Handling: Overly Broad Catch). Here is the code:
try
{
if (!string.IsNullOrEmpty(xsdFilePath))
{
XmlSchemaSet schemas = new XmlSchemaSet();
schemas.Add(null, xsdFilePath);
XDocument xdoc = XDocument.Parse(xmlString);
xdoc.Validate(schemas, (o, e) =>
{
msg += e.Message + Environment.NewLine;
});
}
if (msg != "")
throw new Exception(msg);
}
catch (Exception e)
{
WriteErrorLog("Error in ValidateXml");
LogError(e);
msg = e.Message;
return "Error - Document is invalid: " + msg;
} <pre>
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?
Thanks,
Steve Holdorf
|
|
|
|
|
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.
|
|
|
|
|
Hi,
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
|
|
|
|
|
Somehow you are sorting the string value in stead of the int value
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hello
I have asp.net mvc web application. and now i have requirement for json based service for the same mvc application.
So I am thinking to create web api in the same project, Is this right way or can anyone tell me best way because service need for device as well.
|
|
|
|
|
You could do that, or just call actions on controllers and have them return Json data.
|
|
|
|
|
But that data would be then wrapped in HTML layout adding overhead data.
That is why API is better because it simply returns the data and not the HTML DOM itself.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Not when you return Json, as I said in my post
|
|
|
|
|
Totally right, just go ahead. Include the assemblies for Web API and create the controllers for API (using ApiController base class) and you're done.
Just a few other things to get done a left, such as WebApiConfig.cs etc.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
i have issue while calculating addition of Grid control which has adding rows at run time.
|
|
|
|
|
And are we supposed to guess what the issue is? Put me down for "out of cheese error on line 42".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
elaborate more and add your code, error details something here..
modified 20-Sep-20 21:01pm.
|
|
|
|
|
guestUser cannot access the authenticate webpage and i tried web.config and rolebased authentication using weborms but both are not working?
using Request.IsAuthenticated && !string.IsNullOrEmpty(Request.QueryString["ReturnUrl"]) its working but after logining user if i click same link its redirecting to login webpage.
Anyone give suggestions in this?
|
|
|
|
|
|
I sort of need to calculate the average of all the averages in a report.
I have no clue how to do this, but I do have data.
Do I have enough data here to do this, and perhaps some help with the formula
I saw a couple of examples, but wow it looked so complex.
http://study.com/academy/lesson/calculating-weighted-average-method-formula-example.html[^]
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
'm_avgMarkup +=
'Add up the total margin value
m_totalMargin += sCIR(idx).FMARGIN_PROFIT
rs_Table.Rows.Add(rs_DataRow)
Next
End If
|
|
|
|
|
It just sounds like you need the information about how many items are sold and at what price; then the math is pretty straight forward.
(The sum of all (Item*Price))/Total numbers of items
PS. You are not looking for the weighted sum, unless you don't know how many items are sold. But then your math can't be done.
|
|
|
|
|
Hi, you can get the average by doing this:
m_avgMarkup += sCIR(idx).FMARGIN_PERCENT /idx
below is the whole code,
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
'm_avgMarkup += sCIR(idx).FMARGIN_PERCENT /idx
'Add up the total margin value
m_totalMargin += sCIR(idx).FMARGIN_PROFIT
rs_Table.Rows.Add(rs_DataRow)
Next
End If
hi
|
|
|
|