|
Check this out:
http://www.odetocode.com/articles/450.aspx
We are not a Code Charity
|
|
|
|
|
|
Hello friends,
I want to handle "Back" buttons event of the browser in my code. I want to restrict the user from pressing back button..How can I do that?
Thanks ,
Amit
|
|
|
|
|
You cannot. Don't worry, people ask this all the time. There's no way to handle it, it's not an event, it happens on the client. You can try to hack it, but not successfully.
Usually when people ask this, it's because they have not written the code to handle logout properly, is that your issue ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks, Here logout is not the issue. I want to give message to user, if he clicks the back button only.. I Saw some bank sites..They closing the sessions if user clicks the back button..! How they do that?
Need help..
Amit
|
|
|
|
|
Javascript. But it's not reliable as JS can be turned off by the user.
|
|
|
|
|
Any Example? or documents?
Amit
|
|
|
|
|
|
Thanks...Very goood article...
Amit
|
|
|
|
|
I would avoid using javascript for a security method.
As mentioned before a user can simply turn it off in their browser by-passing your security
We are not a Code Charity
|
|
|
|
|
One thing you can do is redirect all links through location.replace() of JavaScript so that there would be no history and hence back button can be voided to some extent.
You can also try using the history.forward() trick.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
Hi all,
Can anyone tell which one load faster then other GridView, DataList, Repeater, DetailsView, FormView.
Or can you give me a suggestion that which one will works better compare to other controls.
Thanks in Advance
Regards,
Senthil.S
Senthil.S
Software Engineer
|
|
|
|
|
The reason they all exist, is that different situations call for different tools. If one was best, why would MS not just release that one ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hello christian
Thanks for your response. The real situation of main is, i have to create a user control to load the datas from database and the control should be faster.
So i need a control to load the data faster and it should good also.
Thank you
Regards
Senthil.S
Senthil.S
Software Engineer
|
|
|
|
|
Either use a repeater or create your own control. Creating custom controls and binding using a DataReader is fast.
|
|
|
|
|
i am doing it thru javascript..this is the statement..
document.getElementById('ctl00_ContentPlaceHolder1_lstRole').setInputValue=retVal.roleID;
--retVal.roleID //value i need to be selected in list box
--document.getElementById('ctl00_ContentPlaceHolder1_lstRole').setInputValue //list box
the same thing is wrkin for drop down and text boxes but not for list box. can any1 tell me whats wrong in this?
|
|
|
|
|
Hi
I am creating a chat application using ajax asp .net 2.0, here whenever the user enter the text message and hit enter, i have to pass this message to server in ajax, i am doing it right now using the following code
url = 'Chat.aspx?action=chatmsg&u=' + userid +'&msg='+ txtMsg;
req = getAjax();
req.onreadystatechange = function(){
if( req.readyState == 4 && req.status == 200 ) {
updateAll();
}
}
req.open( 'GET', url, true );
req.send( null );
but the problem is some time the txtmsg (user entered message would be in html code). how to pass html formatted message to server using ajax.
Please help
Thanks
SRini
|
|
|
|
|
Are you getting any error ?
Probably tage <> not allowed to send as message. However you can do one thing replace these tag with any special character on client side and then again parse it on server side.
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
Actually, there is a standard format for this already.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok, Thanks Christian G
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
yeah if we appened the formatted html message with quering string, it is not even get called when httprequest.send is happened.
Thanks
SRini
|
|
|
|
|
By html encoding it first. For example, a space becomes %20.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for the reply,
is there any built-in funtion to format the html messges or do we need to need manually parse all tags and convert it to a normal string?
Thanks
SRini
|
|
|
|
|
not sure in js. I would expect you'd find one on the web, I doubt one is built in.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ok i got this function from web and it worked
var encodedHtml = escape(NewsBody_rich.document.body.innerHTML);
encodedHtml = encodedHtml.replace(/\
encodedHtml = encodedHtml.replace(/\?/g,"%3F");
encodedHtml = encodedHtml.replace(/=/g,"%3D");
encodedHtml = encodedHtml.replace(/&/g,"%26");
encodedHtml = encodedHtml.replace(/@/g,"%40");
I was thinking about another way to pass the data to server using hidden textbox
I thought of putting the formatted html message to a asp hidden textbox and take it in the code-behind using the following script
document.getElementById("TextBox1").value=NewsBody_rich.document.body.innerHTML;
but this not working, when i put alert after this script code it shows the TextBox1.Value as assigned html message, but when i debug in the code-behind the TextBox1.Text value is empty. i dont know why?! i did lot of debugging still couldnt able to find, i even replace asp server textbox with html server texbox, still not working!!
Do you have any idea why is it so!?
Thanks
SRini
|
|
|
|