|
Yes..its neccessary to prevent using web pages after being logged out.
there are following ways to do that...
if u r storing some session information while user logs in
clear it or abondon the session on logout event
Session.Abandon();
secondaly u can also clear the browser history on log out event
so that user cant navigate back
history.go(-history.length);
third, if ur using asp.net u can force ur page to load from server every
time instead from client cache. by this if user logs out and navigate back to
previous page he will be redirected to login page
mark property OutputCache to None or NoStore of Page
|
|
|
|
|
Why are you responding?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Web.Config
<system.web>
<authentication mode="Forms">
<forms loginurl="Your Login page" protection="Validation" timeout="60">
|
|
|
|
|
If you mean user should not be able to go back to the page they logged out from, yes, this is very much possible.
I would like to inform you that this is asked here so many times. So do a CodeProject search[^] and you will get a lot of hits.
I will give you a hint. Search for "disable back button" or just "disable back" for more results (select only question and answer check box to get results from Question and Answers). See if that helps you.
If you still don't understand, get back and explain your problem.
|
|
|
|
|
Yes..its neccessary to prevent using web pages after being logged out.
there are following ways to do that...
if u r storing some session information while user logs in
clear it or abondon the session on logout event
<b>Session.Abandon();</b>
secondaly u can also clear the browser history on log out event
so that user cant navigate back
<b>history.go(-history.length);</b>
third, if ur using asp.net u can force ur page to load from server every
time instead from client cache. by this if user logs out and navigate back to
previous page he will be redirected to login page
mark property <b>OutputCache to None or NoStore</b> of <b>Page</b>
|
|
|
|
|
Hi,
you can set the path of the login page in the web.config:
<authentication mode="Forms">
<forms loginUrl="Login.aspx" timeout="600" defaultUrl="Home.aspx"></forms>
</authentication>
|
|
|
|
|
I have my ASP.NET application working fine under Visual Studio's integrated web server.
Also I have set up IIS with my files and can access my application via browser
But My problem is there is a login form which is not working in IIS
but the same login form is working in Visual Studio.
The username and password are not stored in database. I used Form authentication.
My web.config part is shown below
allow roles="Administrators"
deny users="*"
I have everything working fine except the login form in IIS.
Login form is perfectly working under Visual Studio.
Plz help me
|
|
|
|
|
|
DO NOT CROSS POST!
Remove the one that has not had any answers posted to it and read the forum guidelines.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi All,
I am Using Dataset while Reading Values from Excel file .. Evrything is wrking fine but Dataset leave blank some columns , as these columns are in Excel file...
Please help me if u have any idea...
Thanks
prabhakar dwivedi
|
|
|
|
|
prabhakar dwivedi wrote: Evrything is wrking fine but Dataset leave blank some columns , as these columns are in Excel file...
What does this mean? You need to elaborate a little more and explain what is expeced and whats happening.
|
|
|
|
|
hello every one. am trying to create Image from byte array in my page. First i create the image by System.Drawing.Image then am trying to convert System.Drawing.Image to System.Web.UI.WebControls.Image. but the compiler says "Cannot convert type 'System.Drawing.Image' to 'System.Web.UI.WebControls.Image'". So any one please help me.Thxs.
|
|
|
|
|
You can convert to directly to one another.
You need to point the src of the webcontrols.image to an aspx script which then writes the drawing.image to the response stream.
|
|
|
|
|
plz can u make it more brief? thxs.
|
|
|
|
|
Hi All
Please provide code for page ranking as soon as possible.
thanks in advance.....
|
|
|
|
|
rummer wrote: provide code for page ranking
rummer wrote: as soon as possible.
Please use Google Search immediately!!!
We, help those who have put some effort and are stuck up somewhere. People who just ask for code (that too in a hurry) are not encouraged.
BTW: A simple Google search would had provided you lots o information on Page ranking!
Put some effort!!! Try!
|
|
|
|
|
|
Please don't encourage(by providing links and codes) people who have not put in any effort.
They are just being lazy to do even a ground work... we should avoid encouraging such questions.
|
|
|
|
|
ok sure.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
rummer wrote: Please provide code for page ranking
Sure sir, it will be our pleasure to write code on your behalf.
rummer wrote: as soon as possible.
But as you must have read in terms & conditions while signing up for an account on code project that we do not work on week ends. Unfortunately, today is Saturday & we have some plan with our family.
Is it OK with you if we can start writing code from Monday?
Till then you can use google to find any helpful URL.
|
|
|
|
|
hi, iam using asp.net with c#
in my gridview control in template field iam having a checkbox control
when user selects the checkbox that row should be added to data base when user clicks on add button, but user is selecting the check box but without clicking on add button the user is clicking the next button to navigate on other page .how to handle this situation. can u give me example which helps me
|
|
|
|
|
|
I am so sorry. I just saw that answer was not posted. Actually I posted it through my mobile. So may be something went wrong. Posting it again.
You mean if a user checks the CheckBox, he should not be able to click on the button.
You can do this using JavaScript. The logic that you would use here is, if the user checks any CheckBox, you should disable the (next) button. So handle CheckBox's onClick event. And in that even write code to disable the button.
<asp:CheckBox ID="CheckBox1" runat="server" onclick="javascript:disableNavigation();" />
<script type="text/javascript">
function disableNavigation()
{
if(document.getElementById("CheckBox1").checked == true)
{
document.getElementById("Button1").disabled = true;
}
else
{
document.getElementById("Button1").disabled = false;
}
}
</script>
..Go Green..
modified on Saturday, June 5, 2010 2:58 PM
|
|
|
|
|
hi , iam using asp.net with c#
iam sending gridview data in a mail ,but when gridview having many records in pages then, only first page is send in email and other pages are not send , can you correct my code how to send all data in a mail
public override void VerifyRenderingInServerForm(Control control)
{
}
private string GridViewToHtml(GridView gv)
{
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(sw);
gv.RenderControl(hw);
return sb.ToString();
}
protected void Button3_Click(object sender, EventArgs e)
{
if (txtgrandtotal.Text == "")
{
clsdataset.ShowAlertMessage("please click addbutton");
}
else
{
SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["InventoryConnectionString"].ConnectionString);
string note = TextBox2.Text;
Session["note"] = note.ToString();
CheckBox cc; Label id; Label categorynamee; Label itemkey; Label itemkeynamee; Label currentqty; Label salesprice;
Label quantity; Label total;
foreach (GridViewRow rr in GridView1.Rows)
{
cc = (CheckBox)rr.FindControl("chk");
id = (Label)rr.FindControl("Label2");
categorynamee = (Label)rr.FindControl("Label3");
itemkey = (Label)rr.FindControl("Label4");
itemkeynamee = (Label)rr.FindControl("Label5");
currentqty = (Label)rr.FindControl("Label6");
salesprice = (Label)rr.FindControl("Label7");
quantity = (Label)rr.FindControl("Label8");
total = (Label)rr.FindControl("Label1");
Session["Orderno"] = id.Text;
if (cc.Checked == true && cc.Visible == true)
{
SqlCommand cmdupd = new SqlCommand("addnotesproc", con1);
con1.Open();
cmdupd.CommandType = CommandType.StoredProcedure;
cmdupd.Parameters.AddWithValue("@OrderNo", Convert.ToInt32(id.Text));
cmdupd.Parameters.AddWithValue("@Note", TextBox2.Text);
cmdupd.ExecuteNonQuery();
con1.Close();
SqlCommand cmptbldetails = new SqlCommand("Addorderdetails", con1);
cmptbldetails.CommandType = CommandType.StoredProcedure;
con1.Open();
cmptbldetails.Parameters.AddWithValue("@OrderNo",Convert.ToInt32(id.Text));
cmptbldetails.Parameters.AddWithValue("@CategoryNameE",categorynamee.Text);
cmptbldetails.Parameters.AddWithValue("@ItemKey",itemkey.Text);
cmptbldetails.Parameters.AddWithValue("@ItemKeyNameE",itemkeynamee.Text);
cmptbldetails.Parameters.AddWithValue("@CurrentQTY",currentqty.Text);
cmptbldetails.Parameters.AddWithValue("@SalesPrice",salesprice.Text);
cmptbldetails.Parameters.AddWithValue("@Quantity",quantity.Text);
cmptbldetails.Parameters.AddWithValue("@Total",total.Text);
cmptbldetails.ExecuteNonQuery();
con1.Close();
}
}
System.Net.Mail.SmtpClient smtp = new SmtpClient();
System.Net.Mail.MailMessage msg = new MailMessage();
MailAddress fromaddress = new MailAddress("order@xyz.net");
msg.From = fromaddress;
string mailto = Session["Areamanager"].ToString();
msg.To.Add(mailto);
msg.Subject = "your Purchase Details";
msg.Body = "ShopId::" + Session["UserName"].ToString() + "<br><br>" + "ShopName::" + Session["sendershopname"].ToString() + "<br><br>" + "OrderNo::" + Session["Orderno"].ToString() + "<br><br>" + "OrderDate::" + DateTime.Now.ToString() + "<br><br>" + "Total::" + Session["total"].ToString() + "<br><br>" + Session["note"].ToString() + "." + "<br><br>" + GridViewToHtml(GridView1);
msg.IsBodyHtml = true;
smtp.Host = "localHost";
smtp.Port = 25;
smtp.UseDefaultCredentials = true;
smtp.Send(msg);
Response.Redirect("mailsend.aspx");
}
}
i want to send all data from gridview ,can you correct my code which helps me
|
|
|
|
|
hi,
When you use GridView with paging in asp.net it will only load one
page at a time.
So you cannot access all the pages at one time. To send all records in mail
you need to load all the records either in DataSet or in html format.
Once you have all the records in DataSet you can use it's tables to send all
records in mail
Like,
DataSet1.Tables[0]
So, you need to code accordingly.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|