|
1) I am using Forms Authentication. but the page is not redirect to desired
login page after session time out.
wen.config file
<authentication mode="Forms">
<forms name="aspx" timeout="1" loginurl="SessionExpired.aspx">
2)and When I debug the application
. Session_end is called. in the Session_End
method i write code to redirect to the LoginPage but it is still not
redirecting.
void Session_End(object sender, EventArgs e)
{
Response.Redirect("SessionExpired.aspx");
}
its threws an exception...
'((System.Web.HttpApplication)(this)).Response' threw an exception of type 'System.Web.HttpException'
in both the cases im not able to redirect to "SessionExpired.aspx"
|
|
|
|
|
First thing to remember always is that web applications are stateless, despite what the ASP.NET framework has set up for you to kid you on that it is stateful. This means that ASP.NET is using a number of "parlour tricks" to allow you to develop stateful web applications while hiding the real architecture of web applications. Sometimes the "parlour tricks" don't work the way you expect simply because there is no real substance as there would be in a real stateful architecture (e.g. WinForms)
1. When you say it is not redirecting to the log in page after the session time out, are you sitting waiting at your browser expecting after one minute for it to automatically update your page? That isn't going to happen because it is up to the client to do that, but all your code is at the server.
You have two choices that I can think of off the top of my head: (1) Add some javascript that peforms the redirection for you, or (2) use a meta refresh[^] to do it.
2. The Session_End event handler is not called in response to a user request, therefore, without the request there can be no response. The session is just another of ASP.NET "parlour tricks" to give you state information to make it appear that you are developing against a stateful architecture.
|
|
|
|
|
Hi all
I want this......i dont know y.........
I am populating a gridview and every field of the grid view should be a button which should redirect to the Edit.aspx page.
So I want 2 things:
1.) Every gridview field should be a button.
2.) I want a specific field(emailid) of the row in which button has been clicked.
Am i clear to u...........???? please help.........
|
|
|
|
|
hi
i have smilar code for you, this code work for user query string on gridview,
i but hyrplink and image on it, you can chane it,
<asp:gridview id="GridView1" runat="server" height="341px" width="493px" autogeneratecolumns="False" xmlns:asp="#unknown">
DataSourceID="SqlDataSource1" style="z-index: 100; left: 32px; position: absolute; top: 260px"
BackColor="LightGray" BorderColor="White" Font-Size="10pt" CaptionAlign="Bottom" >
<columns>
<asp:boundfield headertext="H1" datafield="B" />
<asp:boundfield headertext="F" datafield="F" />
<asp:boundfield headertext="S" datafield="S" />
<asp:templatefield>
<itemtemplate>
<asp:hyperlink id="HyperLink1" runat="server" imageurl="<%# Eval("ID", "images/check.jpg") %>">
NavigateUrl='<%# Eval("ID", "Items/Show.aspx?ID={0}") %>'></asp:hyperlink>
</itemtemplate>
</asp:templatefield>
</columns><gridview>
</gridview></asp:gridview>
|
|
|
|
|
vaibhavbaweja wrote:
I want this......i dont know y.........
vaibhavbaweja wrote: Am i clear to u...........???? please help.........
Don't use this types of Chatting language here. This can be good in any messenger or SMS not here.
vaibhavbaweja wrote:
So I want 2 things:
1.) Every gridview field should be a button.
2.) I want a specific field(emailid) of the row in which button has been clicked.
Try to use Gridview Template Field .
cheers,
Abhijit
|
|
|
|
|
but i want every field of the grid to be a button or link button....
template field will add an extra column......
2. n hw can i retrive the specific field of a row corresponding to the clicked button.
tried using Onrow command.....but its not working......
|
|
|
|
|
I want to know the code how to save data from dynamically created textboxes.
The code I have written is this in whch I have dynamically created label and textboxes in a html table.The data in the label is from a table
The code I have written so far is
public partial class _Default : System.Web.UI.Page
{
TableRow row;
TableCell cell;
Label label1;
TextBox text;
SqlConnection cnn = new SqlConnection("server=.;database=northwind;uid=sa;pwd=");
void loaddata()
{
SqlCommand cmd = new SqlCommand("select * from Categories", cnn);
SqlDataReader dr;
cnn.Open();
dr = cmd.ExecuteReader();
int i=1;
while (dr.Read())
{
row = new TableRow();
cell = new TableCell();
label1 = new Label();
label1.Text = dr["CategoryName"].ToString();
cell.Text = label1.Text;
row.Cells.Add(cell);
cell = new TableCell();
text = new TextBox();
text.ID = "text" + i;
cell.Controls.Add(text);
row.Cells.Add(cell);
Table1.Rows.Add(row);
i++;
}
cnn.Close();
dr.Close();
}
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{ //Initiate the counter of dynamically added controls
this.NumberOfControls = 0;
}
else
{
// //Controls must be repeatedly be created on postback
this.loaddata();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
for (int i = 1; i <= NumberOfControls; i++)
{
SqlCommand cmd = new SqlCommand("insert into DUTYDATE (DateofDuty) values(@DateofDuty)", cnn);
try
{
string name = "text" + i.ToString();
TextBox tb = Table1.FindControl(name) as TextBox;
cmd.Parameters.AddWithValue("@DateofDuty", tb.Text);
}
catch (Exception)
{
}
}
}
protected int NumberOfControls
{
get
{
return (int)ViewState["NumControls"];
}
set
{
ViewState["NumControls"] = value;
}
}
}
can anyone tell how do i save data whch the user enter at run time as this code is not running....................
|
|
|
|
|
|
savianand wrote: Subject: Please Help its urgent!!!!!!!!!!!!!!!!!!!!
Never put subject line in that way. It's not the right way to ask question. Put proper subject line, that other members can have an understanding from you subject.
savianand wrote: l how do i save data whch the user enter at run time
When ever you created the text box dynamically, you should have id . So at the time of save data , just read value from those id and save it to database.
cheers,
Abhijit
|
|
|
|
|
I asked around, and no-one else here thinks it's urgent. I guess this means you need to work in such a way that you get your help before you are in a tight jam and relying on charity to get you out.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Would u tell me how can i managed the data with primary key or Uniqe Key if i m save data in SQL Server from Windows Application but i want that if i remove data from Second Table and in 2nd Table is using Unieqe Key . if i remove a particuler ID then it Will not Remove bcz its It used in Master table and it will not remove and give Error .
so tell me how can i do this thing
i hope u understand wht i want to say ........
thanx
Naim Khan
|
|
|
|
|
hi
you have 2 solution,
1- you can set relation ship between them, and give permison to delete when primary key is deleted for table1, so table 2 will delete qutomaitcaly,
2- Or you should remove according to your relationship.
|
|
|
|
|
naim khan wrote: Subject: Hello EveryOne
This is useless. Nothing is there for giving such kind of subject line. please read forums guide lines before post.
naim khan wrote: Would u tell me how can i managed the data with primary key or Uniqe Key if i m save data in SQL Server from Windows Application but i want that if i remove data from Second Table and in 2nd Table is using Unieqe Key . if i remove a particuler ID then it Will not Remove bcz its It used in Master table and it will not remove and give Error .
Is this anything related with asp.net. This is ASP.Net , Please post it to SQL Forum.
cheers,
Abhijit
|
|
|
|
|
hi my friends,
i have html editor in asp.net(C#) webpage.
i am using iframe to get html page in another page.
is there any way to post directly html page to webpage? for example codeproject.com mesage board are using this
whenever i am writing this to you geting message directly without iframe or something else on page.
Thanks for all replying
|
|
|
|
|
cmpemikail wrote: is there any way to post directly html page to webpage?
Use a Literal control in your ASPX or ASCX file?
|
|
|
|
|
Hi All
I already Written a web service (web method) to recive sales data from various branches as XML file.
After reaching to Webmethod I am updatingthat infor to SQL server.
some times My sql server wilbe down and need to update the data once my SQL server got up.
Right now I am storing received XML's (if my sql server is down) into directory for not sending it again by branches.
need method to chek for SQL connection ... and if connection is available read the saved files and post it to Data base.. I like todo this without triggering phically. Need to run the method in time interval of every one hour to push the data to SQL.
Thanks in Advance for the help
Vas
|
|
|
|
|
Hi ALl
I have one wb based application of payroll system.I have all requirements and everything but i am weak in deasigning part.
Can u pls help me in designing like company information web form?
How it looks,how i design?
If u have any designing part,pls send me just related to this application.
Thanks
Monika
|
|
|
|
|
Monika, i suggest you to visit a free template site live
steve-templates.com and try searching for template
|
|
|
|
|
Hi to all,
I am working on a web project.The concept is based on online shopping cart.Please reply so that I can explain my problem.
thanx....
|
|
|
|
|
R1119 wrote: Please reply so that I can explain my problem.
What keeps you from explaining the problem before someone replied?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Actually I have to make a websiite which is similar to
www.eurowirecontainers.com
but i am unable to understand how to manage the database according to the user interface.
please check the above site.
|
|
|
|
|
The problem is when we click on any one item of menu,I am unable to fetch data from database.
|
|
|
|
|
Your question is too general. You have to be more specific about what the actual problem is.
To begin with, you haven't even specified which server language and which database you are using.
I could make a guess what your problem is, and write some example code for a specific language and database, using a made up database design, but what are the odds that I would even come close to anything that is remotely useful?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,
How i administer the back end database tables without directly altering it using SQL commands.
Give me ideas how i do that .
or direct me in right firection any article or Page poiting to this issue .
Best regards
Rameez
|
|
|
|
|
rameez Raja wrote:
How i administer the back end database tables without directly altering it using SQL commands.
What does it mean ?
rameez Raja wrote: or direct me in right firection any article or Page poiting to this issue
What is that ?
cheers,
Abhijit
|
|
|
|