|
For questions like that you should first look at the documentation.
Have a look at the Remove, RemoveAt, RemoveRange and RemoveAll methods.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Check this[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Hi all,
I wants not allow user to revisit the previous pages once he logged out.
I am using master page, in that i placed a logout linkbutton.
When user clicks on logout button, i am redirecting user to loginpage.aspx.
In the Design of loginpage.aspx i wrote the following javascript to prevent user to navigate through browser -> & <- buttons.
LoginPage.aspx:
<%@ Page Language="C#" MasterPageFile="~/ProxyAds.master" AutoEventWireup="true"
CodeFile="LoginPage.aspx.cs" Inherits="LoginPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="server">
<script language="javascript" type= "text/javascript">
if (window.history) {
window.history.forward(1);
}
</script>
<div id="home">
//Login Controls here....
</div>
</asp:Content>
.........................
But its not working.
any thing i am doing wrong ?
please suggest me.
thanks in advance.
|
|
|
|
|
hi,
try giving like this
window.history.forward(-1)
T.Balaji
|
|
|
|
|
Thanks balaji, thanks for ur suggestion.
There is nothing wrong in that logic, its woks fine.I already tested that logic by placing that on MasterPage.
But the problem is it totally not allowing user to navigate through browser buttons. through out the application it is not allowing.
I dont want that kind of functionality. I only wants user to not allow to visit previous pages only after he logged out from site.
Is that ok place Script in LoginPage.aspx ? bcz its the home page.
Please suggest me,
Thanks in advance.
|
|
|
|
|
Hi Shekhar,
Dilip Here.
In such situations, why don't you use window.histoty.delete.
But i am suggesting to use C# backcode to handle such situations.
when user log in, you would store his userid in session.
when user log out you would delete userid from session.
when user passes any request (either with browser back button or giving url in addressbar), you can check in page load event whether user is loggin or not. if not than you can redirect page to login page
Regards
Dilip Patel
|
|
|
|
|
Thanks dilip, thanks for ur suggestion.
I implemented that also, with this the ploblem is when user hits browser(<- & ->) buttons control, some times is not comming into PageLoad event. I checked by placing BreakPont on Pageload. May be the reason is Browser is catching the previous pages when we hit <- buttons it simply displays the page.
If i put the above logic in MasterPage working fine,but the problem is it totally not allowing user to navigate through browser buttons. through out the application it is not allowing.
I dont want that kind of functionality. I only wants user to not allow to visit previous pages only after he logged out from site.
Is that ok place Script in LoginPage.aspx ? bcz its the home page.
Please suggest me,
Thanks in advance.
|
|
|
|
|
What are the possible security attacks of using mirrored local accounts
on both web server on & remote pc for accessing remote files using impersonation & LogOnUser Win32 API ?
Also,is there any side effects to the my application while switching user to run asp.net
process to access remote files?
And
How to create mirrored user account on server with least privileges?
Thanks
From
Mitesh Patel
|
|
|
|
|
i am using ajax in my web application and changed my web configue according to that but still i am getting this error,can you plz tell me whats the possible cause...
web configue code is...
< httpHandlers>
<remove verb="*" path="*.asmx">
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
< add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false">
< add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304">
<httpHandlers>
< httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<httpModules>
plz plz plz help me its vry urgent....
Maniiiiiiiiiiiiiii
|
|
|
|
|
Take a google search.[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
before posting here i have already taken up the google search....
Maniiiiiiiiiiiiiii
|
|
|
|
|
mnkh wrote: plz plz plz help me its vry urgent....
Please don't do that. It is rude.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
pls help restricting multiple logon to an application with single user account.
Here wht m doing is ,
m checking login details against a database.
if is a valid user then allowing to browse throuth the application.
my requirement is if one user is loged in and if someother user tries to login with same user account i need to restrict the second user saying "this login is already in use".
I can maintain a temp table for this , whenever a login is success i can update "isloged" field as true and we can set it false when user logs out. but how can we handle situations like
if a user logs in and closes bowser close button instead of log out.
if a user logs in and leaves doing nothing.
pls help in resolving this, if possible write a sample code for me.
thanks in advance.
|
|
|
|
|
Repost
The Web Developer. Beirout-Lebanon
|
|
|
|
|
yes, its a repost...
waiting for the solution.........
thanks
|
|
|
|
|
why you don't search for the solution rather tahn reposting and waiting
do you know that google is your friend
The Web Developer. Beirout-Lebanon
|
|
|
|
|
You would not say m not trying for the solution if you would have studied my post clearly.
I have mentioned everything ,
Try to help someone.
|
|
|
|
|
Hi Surender,
Dilip Here again, sorry for late response, i was busy....
so your problem is as
[1] if a user logs in and closes bowser close button instead of log out.
==> if user is log in and close browser then you can call a javascript function on body's(HTML tag) unload event and in that function you can all a server side function which will perform logout procedure. for that you can use ICallback interface or you can use XMLHttpRequest.
[2] if a user logs in and leaves doing nothing
==> in such situations, your session will be expired. and when session expires, you can do coding of logout in session_end event.
OK, May my suggesions helpful to you.
Regards
Dilip Patel
|
|
|
|
|
dilip_rollwala wrote: if user is log in and close browser then you can call a javascript function on body's(HTML tag) unload event and in that function you can all a server side function which will perform logout procedure. for that you can use ICallback interface or you can use XMLHttpRequest.
What if JS is disabled?
|
|
|
|
|
Thanks dilip for ur valuable suggistions......
i'll try to implement the said things
Thanks once again
cheers,
Try to help someone
|
|
|
|
|
surender939 wrote: if a user logs in and closes bowser close button instead of log out.
if a user logs in and leaves doing nothing.
You can write a SQL Job which checks the tables and update the flag which are expired. For this, you need to keep a timestamp which gives the last accessed time.
|
|
|
|
|
I have a gridview that has a column of textbox that users input something in textbox.I want to retrieve text of textboes after postback,so i wrote this code to store texts of textboxes in list and list in a session.but I don't know how to show them agian in textboxes.
my code to store text of textboxes:
protected void Button1_Click(object sender, EventArgs e)
{
List<string> qy = new List<string>();
foreach (GridViewRow gvr in GridView1.Rows)
{
TextBox q = (TextBox)gvr.FindControl("textbox5");
if (Session["quantity"] == null)
{
qy.Add(q.Text.Trim());
Session["quantity"] = qy;
}
else
{
((List<string>)Session["quantity"]).Add(q.Text.Trim());
}
}</string></string></string>
-----------------------------
and in pageloade i wrote this but I don't know how to continue it:
if(Session["quantity"]!=null)
{
List<string> temp=(List<string>)Session["quantity"];
foreach(GridViewRow gvr in GridView1.Rows)
{
TextBox tq=(TextBox)gvr.FindControl("textbox5");</string></string>
|
|
|
|
|
You can use the Grd Row Created Event
|
|
|
|
|
Just true the EnableViewState property of textvox or your grid.
|
|
|
|
|
the viewstates are true.I want to show text in textboxes agian after postback.
|
|
|
|