my site is getting dead (Not Working) after half n hour..

Posted by Neer under Others on 2/8/2012 | Points: 10 | Views : 994 | Status : [Member] | Replies : 17
Hi Friends,

I am Facing another problem. If I don't access my site for half n hour , my site is not working. it needs to refresh and then working.

Any Suggestion? Any Help?

-Neer

-Neer


Responses

Posted by: Sksamantaray on: 2/8/2012 [Member] Silver | Points: 25

Up
0
Down
Is it hosted?
Yes-what's the url?
No- Please show what's there in home page.

Do you face this problem after opening the home page and leave it for half an hour?
Mention everything in detail.

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down

From Yes If i am not using the page for half n hour then after that not working.
If i use with in half hour then its keep working.

if i dont use for half hour i need to refresh befor searching.

-Neer

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down

Do you use any Session variable in page-1?

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
Yes Sir , It's storing session values and passing to search page.

-Neer

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down
so after 30mins when you try search the session value get lost
do check the value of session variable if it is found to be null then reset it before you call search method.

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
but i am writing in text box and then on button_click i am storing that value in session and then redirect to another page..

i m typing at the time of clicking so no mater of expiring session, if still it's how to increase session time out ?

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down
you can increase session timeout in web.config

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down

setting timeout for session:


<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

<sessionState timeout="60" />



You can however check the status of Session in Search Button Click
if it is null then call the home page again else do your search activity.
so you need not have to refresh the page.

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
U sure I increase value this much for http runtime?

my time out is only 60 n u point to 3600,

then pool will be occupied then pool size error will come again no?

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
One More Concern is,

The button's click event is not taking place.. , i mean page is not working because that button is not allowing click.

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down
in the design mode , double click on button and see it goes to right event in .cs page?

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
YES SIR... REPLY ASAP ...

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
IT GOES TO THE RIGHT EVENT. IT WORKS WELL WITH IN TIME.. AS IT STAY'S IDEAL AFTER 30 MINUTE THE BUTTON DOES NOT WORK.

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down
can you add code of your button event?

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
String Temp = txtbyCompanyorName.Text;

String Temp1 = Temp.Replace(" { ", "_");
Temp = Temp1.Replace(" } ", "_");

string[] arInfo = new string[4];
char[] splitter = { '_' };
arInfo = Temp.Split(splitter);

int n = Temp.IndexOf("_");
if (n != -1)
{
Session["abc1"] = ""; Session["abc2"] = ""; Session["abc3"] = "";

for (int x = 0; x < arInfo.Length; x++)
{
if (arInfo[0] != null)
Session["abc1"] = arInfo[0].ToString();
else
Session["abc1"] = null;

if (arInfo[1] != null)
Session["abc2"] = arInfo[1].ToString();
else
Session["abc2"] = null;

if (arInfo[2] != null)
Session["abc3"] = arInfo[2].ToString();
else
Session["abc3"] = null;

}

}
else
{
if (RadioButtonList1.SelectedItem.Text == "Company/Name")
{
Session["abc1"] = txtbyCompanyorName.Text;
Session["abc2"] = "";
}
if (RadioButtonList1.SelectedItem.Text == "Product/Services")
{
Session["abc2"] = txtbyCompanyorName.Text;
Session["abc1"] = "";
}
}

if (DropDownList1.SelectedItem.Text == "All Area")
{
Session["ByArea"] = "";
}
else
{
Session["ByArea"] = DropDownList1.SelectedItem.Text;
}


if (txtbyCompanyorName.Text == "")
{
lblmsg.Text = "Please enter the search text";
}
else
{
Database db = new Database();
string str = "select * from ABDatabase where (CompanyName like '" + Session["abc1"].ToString() + "%' and BusinessCategory like '%" + Session["abc2"].ToString() + "%' ) and Area like '%" + Session["ByArea"] + "%' order by CompanyName";

if (db.GetDataReaderQuery(str).Read())
{
Response.Redirect("Search.aspx");
}

else
{
lblmsg.Text = "Search result is not found, please try again";
}
}

}

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 2/9/2012 [Member] Silver | Points: 25

Up
0
Down

1. Session["abc1"] = ""; Session["abc2"] = ""; Session["abc3"] = "";
why you are asingning blank values to Session varables you can assingn null instead.
Session["abc1"] =null; Session["abc2"] =null; Session["abc3"] = null;
2.before you make dbcall:
check: if(Session["abc1"]!=null and Session["abc2"] !=null and Session["abc3"]!=null)
{
//do db call here
}
else
{
//show your message
// or try to set sesstion values again
}

Thanks,
Sanjay

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neer on: 2/9/2012 [Member] Starter | Points: 25

Up
0
Down
tHANK U.. i WILL aPPLY THIS TODAY

-Neer

Neer, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response