|
Actually when web.config changes all the session variables will expires and my application generates exception at the time of checking any of the Session variable. The main problem is the Exception which is caused by web.config change. So how and where am I able to detect this Session related exception in the application?
Sandip
Software Engineer
India.
|
|
|
|
|
you can check if a session exists. I think your checking for a value or something, but the value of the session appears to be null because the session doesn't exist anymore...
<br />
if ((page.Session["YourSession"] != null)<br />
&& (page.Session["YourSession"] == "RequiredValue"))<br />
DoSomething();<br />
else<br />
Response.Redirect("DefaultSessionDoesNotExistPage.aspx");<br />
|
|
|
|
|
Why don't you just use a custom error page? This will do all the redirect stuff for you?
|
|
|
|
|
Problem: I am not able to put message into Queue If I am accessing the application from an URL instead of running the application from IDE.
----------------------------------------------------
General Information
1. Visual Studio 2005, Framework 2.0
2. WMQ 5.3 trial version
When we run our application from dot net IDE then we are able to put message into Queue, but if we access the application from an URL then we are not able to put the message to Queue.
The information fromt the event viewer is
--------------------------------------------
Entity 'aspnet' has insufficient authority to access object 'T2RQM'.
The specified entity is not authorized to access the required object. The following requested permissions are unauthorized: connect
Ensure that the correct level of authority has been set for this entity against the required object, or ensure that the entity is a member of a privileged group.
------------------------------
I added the aspnet account to both Administrator and MQM groups, still its not working. One thing which I noticed is that it is working fine in system where Visual Studio 2005 is not installed
|
|
|
|
|
Anybody is having any idea about it?
The sytem where Visual Studio 2005 is not installed are Windows 2003 system and others are XP
|
|
|
|
|
Hi ALl
I have one datagrid in asp.net.I generate columns in grid.
But i know how to add column in c# with asp.net like
DG.Columns.Add(SetStyle(new BoundColumn(),"Order","OrderID",""));
DG.Columns.Add(SetStyle(new BoundColumn(),"Order Date","OrderDate","{0 }"));
DG.Columns.Add(SetStyle(new BoundColumn(),"Required Date","RequiredDate","{0 }"));
but when i write this code in vb.net with asp.net ,it gives an error.
How can i write in asp.net?
if u have and,pls give me guidenece.
Thanks
monika
|
|
|
|
|
Remove semi-colon from end of the statement
Thomas
|
|
|
|
|
hi,
use
www.developerfusion.co.uk/Utilities/convertvbtocsharp.aspx
to change ur code from vb.net to c#.net.It may help u a lot
rupa
|
|
|
|
|
hi all
I have byte [] is a image (JPG) in database
I want show on System.Web.UI.WebControls.Image
some pepole say with me
Response.OutputStream but it will delete all my control in my pape
so i want give byte[] to System.Web.UI.WebControls.Image
some body help me
|
|
|
|
|
You can not include the image data in the same response as the page itself. You either have to save the data to a file, or use a proxy page that acts as a saved file by getting the data from the database and sending it as response.
---
b { font-weight: normal; }
|
|
|
|
|
HI
If you want to get the image from the database which is in the bytes and want to show on aspx page in image control ok
then you can do that what you have to do is first get the image from the database and store it in some temporary folder with extension jpg for that you have to do some conversion look at the code below
System.Drawing.Image newImage;
SqlConnection conn = null;
SqlCommand cmd = null;
DataSet ds = new DataSet();
SqlParameter UserNamedb = null;
SqlParameter AlbumNamedb = null;
conn = new SqlConnection(ConnectionString);
conn.Open();
cmd = new SqlCommand("GetAlbum", conn);
cmd.CommandType = CommandType.StoredProcedure;
UserNamedb = new SqlParameter("@UserName", SqlDbType.VarChar);
UserNamedb.Value = "SandeepAkhare";
cmd.Parameters.Add(UserNamedb);
AlbumNamedb = new SqlParameter("@AlbumName", SqlDbType.VarChar);
AlbumNamedb.Value = "ccccccccccccc";
cmd.Parameters.Add(AlbumNamedb);
SqlDataAdapter ad = new SqlDataAdapter(cmd);
ad.Fill(ds);
conn.Close();
string path = @"c:\AlbumFromdatabase" + "\\" + "SandeepAkhare";
Directory.CreateDirectory(path);
foreach (DataRow dr in ds.Tables[0].Rows)
{
Byte[] imageData = (byte[])dr[0];
string FilaName = dr[1].ToString();
using (MemoryStream ms = new MemoryStream(imageData, 0, imageData.Length))
{
ms.Write(imageData, 0, imageData.Length);
// newImage = Image.FromStream(ms, true);
Bitmap bm = new Bitmap(new MemoryStream(imageData));
newImage = bm;
newImage.Save(path + "\\" + FilaName);
}
}
|
|
|
|
|
Perhaps you should reply to the OP instead of replying to my reply.
---
b { font-weight: normal; }
|
|
|
|
|
|
Dear all,
My issue is that I don't want to submit the form is the checkbox isn't checked and i want to make it through validators
which validator should i use and how?
Best Regards
3ala2
|
|
|
|
|
|
i know!!!
But i can't control the button action
because i have other validators in the form
so i can do both together
anyway, i'm workin on something guess it should work...
Thanx for replying
Best Regards
3ala2
|
|
|
|
|
validation contrlos are predefined.genrally works on text boxes.it is not possible as per user by validation controls.if u realy want to validate u have to write seperate logic for that.by using script lagu..
|
|
|
|
|
I did it...
var ucName = "UcPayToAccountant1_";
function jsValidate()
{
if ( checkAmount() && checkDone() )
{
Page_ClientValidate();
return true;
}
else
{
return false;
}
} // End Function
function checkAmount()
{
var amount = document.getElementById(ucName + "txtAmount").value;
if ( isNaN(amount) )
{
return false;
}
else
{
return true;
}
} // End Function
function checkDone()
{
var done = document.getElementById(ucName + "chkDone");
if (done.checked)
{
return true;
}
else
{
return false;
}
} // End Function
added the onclick attribute the button
so using Page_ClientValidate(); function which the validator generates solved the probelm
Best Regards
3ala2
|
|
|
|
|
Hi,
I have created a web service(service.asmx). I have used basic windows authentication for web service. Please see my code which i had written in code behind.
TestWebService.Service ObjSer = new TestWebService.Service();
ObjSer.Credentials = CredentialCache.DefaultCredentials;
Label1.Text=ObjSer.HelloWorld().ToString();
But i got the following error...
"The request failed with HTTP status 401: Access Denied."
Could u please advise what is wrong with me?
Bye,
Poovarasan
|
|
|
|
|
Hi,
In page1, I am listing employee names in drop down list and selecting some name from the list. I am having one linkbutton in that page. when i click that button it takes to other page2 thro response.redirect. From that page2 when i click home link it comes back to page1 and in this page1 i have to retain the same value in dropdownlist but it shows only the first listitem in the dropdownlist. Please Help.
Thanks in Advance.
Regards,
Prya
|
|
|
|
|
When you fill DropDownList fill it inside Page_Load event use !Page.IsPostBack
example
<br />
if (!Page.IsPostBack)<br />
{<br />
}
"My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates
|
|
|
|
|
Yes I am filling the list only in Page_Load under!(IsPostBack). My Code:
if (!(IsPostBack))
{
ddlEmpName.DataSource = loadEmployee;//loadEmployee-DataSet
ddlEmpName.DataTextField = "EmpName";
ddlEmpName.DataValueField = "EmpName";
ddlEmpName.DataBind();
}
Prya
|
|
|
|
|
Hi prya
write this code after bind Dropdown list.
DD.Items.FindByText(session["item"], String).ToString).Selected = True
U have to store selected item in session["item"]
Pathan
|
|
|
|
|
Why __VIEWSTATE comes in querystring?
Anyone have any idea and please reply as soon as. This is very urgent.
Thanks in Advance.
Regards
R.Arockiapathinathan
|
|
|
|
|
Hahaha, how can this be urgent... Viewstate can be a very very very powerfull tool for developing ASP.NET webpages. But you can switch them off using the page's EnableViewState property... is that quick enough for you??
|
|
|
|