Dovberman
asked on
Need to Set the Session Variable
I need to store session information.
private void LogError(SqlConnection pconStockSelect)
// Collects error information and saves it in the errors table.
{
strErrMessage = Session["Message"].ToStrin g();
error: the Session variable is null.
How do I set the Session variable?
Thanks,
private void LogError(SqlConnection pconStockSelect)
// Collects error information and saves it in the errors table.
{
strErrMessage = Session["Message"].ToStrin
error: the Session variable is null.
How do I set the Session variable?
Thanks,
You set a session like so
Session["session_name"] = "Text";
But that's got nothing to do with the code you posted
Session["session_name"] = "Text";
But that's got nothing to do with the code you posted
ASKER
The ShowError page is opened when an exception is triggered.
I have try/catch blocks in several places.
The exception that opened this page is not handled.
I need to see a stack trace to find out where the exception occurred.
The exception is somewhere in this code that attempts to set up a site map.
The bug was removed when I removed this code from the master page:
<tr id="rowSiteMap">
<td colspan="2" style="width: auto; height: 24px;
font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; font-style: normal;
font-variant: normal; border: thin solid #0000FF;
color: #0000FF; background-color: #FFFFCC; text-align: left;">
<asp:SiteMapPath ID="SiteMapPath1" runat="server" Width="65%" Font-Size="12pt">
<PathSeparatorTemplate>
<asp:Image ID="Image1" ImageUrl="~/Images/arrowri ght.gif" runat="server" />
</PathSeparatorTemplate>
<RootNodeTemplate>
<b style="font-family: Arial, Gill Sans; font-size: 14px; " >You are here </b>
</RootNodeTemplate>
<CurrentNodeTemplate>
<%# Eval("title") %>
<br /><b style="font-family: Arial, Gill Sans; font-size: 12px"></b>
<%# Eval("description") %>
</CurrentNodeTemplate>
</asp:SiteMapPath>
</td>
</tr>
Could you recommend a document that shows how to set up the site map?
I would also like to know how I can get exception information when I have no idea where the exception came from.
This is the web.config statement that directs exceptions to the exception details page.
<customErrors mode="On" defaultRedirect="~/ErrorHa ndling/Sho wError.asp x">
</customErrors>
Thanks,
Thanks,
I have try/catch blocks in several places.
The exception that opened this page is not handled.
I need to see a stack trace to find out where the exception occurred.
The exception is somewhere in this code that attempts to set up a site map.
The bug was removed when I removed this code from the master page:
<tr id="rowSiteMap">
<td colspan="2" style="width: auto; height: 24px;
font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; font-style: normal;
font-variant: normal; border: thin solid #0000FF;
color: #0000FF; background-color: #FFFFCC; text-align: left;">
<asp:SiteMapPath ID="SiteMapPath1" runat="server" Width="65%" Font-Size="12pt">
<PathSeparatorTemplate>
<asp:Image ID="Image1" ImageUrl="~/Images/arrowri
</PathSeparatorTemplate>
<RootNodeTemplate>
<b style="font-family: Arial, Gill Sans; font-size: 14px; " >You are here </b>
</RootNodeTemplate>
<CurrentNodeTemplate>
<%# Eval("title") %>
<br /><b style="font-family: Arial, Gill Sans; font-size: 12px"></b>
<%# Eval("description") %>
</CurrentNodeTemplate>
</asp:SiteMapPath>
</td>
</tr>
Could you recommend a document that shows how to set up the site map?
I would also like to know how I can get exception information when I have no idea where the exception came from.
This is the web.config statement that directs exceptions to the exception details page.
<customErrors mode="On" defaultRedirect="~/ErrorHa
</customErrors>
Thanks,
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
{
string errmsg = Session["Message"];
// do other stuff
}