Click here to Skip to main content
15,914,419 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionwindow authentication Pin
Sonia Gupta21-Nov-07 0:05
Sonia Gupta21-Nov-07 0:05 
AnswerRe: window authentication Pin
Pete O'Hanlon21-Nov-07 0:18
mvePete O'Hanlon21-Nov-07 0:18 
QuestionHow to get MAC address of a remote machine using ASP.NET..? Pin
Balagurunathan S20-Nov-07 23:46
Balagurunathan S20-Nov-07 23:46 
AnswerRe: How to get MAC address of a remote machine using ASP.NET..? Pin
Sandeep Akhare20-Nov-07 23:49
Sandeep Akhare20-Nov-07 23:49 
GeneralRe: How to get MAC address of a remote machine using ASP.NET..? Pin
Balagurunathan S21-Nov-07 0:01
Balagurunathan S21-Nov-07 0:01 
GeneralRe: How to get MAC address of a remote machine using ASP.NET..? Pin
Balagurunathan S21-Nov-07 0:06
Balagurunathan S21-Nov-07 0:06 
GeneralRe: How to get MAC address of a remote machine using ASP.NET..? Pin
Sandeep Akhare21-Nov-07 0:16
Sandeep Akhare21-Nov-07 0:16 
QuestionHow to use ASP.Net with Javascript? Pin
blooper0220-Nov-07 23:45
blooper0220-Nov-07 23:45 
Hi guys,

I have a problem here that I have been unsucessful at solving.

I have a form for user to fill in.

On button click, I perform a series of validations.

Only when the validations pass, I open up a confirm box using javascript.

When the user clicks "OK" I proceed to save the information.
When the user click "Cancel" I refrain from saving the information.

In pseudo code its like this:

btnSave_Click(object sender, EventArgs e)
{
string status= ValidateData();

if(status=="OK")
{
//bring out the confirm box in javascript
ClientScript.RegisterStartupScript(this.GetType(), "ConfirmationPopUp", "getMessage('" + mess.ToString() + "')");
if(userClickOk=="OK")
{
SaveData();
}
}
}

I finally understand that i need a postback from the confirm popup to finally run the SaveData();

So in my java script i try to save the answer in a HiddenField and then on post back check the reply and run SaveData() if the answer is yes.

my Javascript goes like this:

function getMessage(a)
{
var ans;
ans=window.confirm(a);
//ans=;
//alert (ans);
if (ans==true)
{
this.ctl00_ContentPlaceHolder1_HiddenField1.value='Yes';
__doPostBack("","");

}
else
{
this.ctl00_ContentPlaceHolder1_HiddenField1.value='No';
__doPostBack("","");
}
}



However when i try to save the answer in the HiddenField1. I get error that says
this.ctl00_ContentPlaceHolder1_HiddenField1 is null or not an object.

What is wrong? here? I have also tried to save in a session variable which is also not possible?

Please advise how i can achieve this? Is this the right way to do it?

Thanks so much.
AnswerRe: How to use ASP.Net with Javascript? [modified] Pin
Sun Rays20-Nov-07 23:49
Sun Rays20-Nov-07 23:49 
GeneralRe: How to use ASP.Net with Javascript? Pin
J4amieC21-Nov-07 0:14
J4amieC21-Nov-07 0:14 
GeneralRe: How to use ASP.Net with Javascript? Pin
blooper0221-Nov-07 16:02
blooper0221-Nov-07 16:02 
AnswerRe: How to use ASP.Net with Javascript? Pin
John-ph20-Nov-07 23:56
John-ph20-Nov-07 23:56 
GeneralRe: How to use ASP.Net with Javascript? Pin
blooper0221-Nov-07 14:14
blooper0221-Nov-07 14:14 
GeneralRe: How to use ASP.Net with Javascript? Pin
John-ph21-Nov-07 19:49
John-ph21-Nov-07 19:49 
GeneralRe: How to use ASP.Net with Javascript? Pin
blooper0221-Nov-07 21:19
blooper0221-Nov-07 21:19 
GeneralRe: How to use ASP.Net with Javascript? Pin
John-ph21-Nov-07 23:10
John-ph21-Nov-07 23:10 
GeneralRe: How to use ASP.Net with Javascript? Pin
blooper0221-Nov-07 23:28
blooper0221-Nov-07 23:28 
GeneralRe: How to use ASP.Net with Javascript? Pin
John-ph21-Nov-07 23:49
John-ph21-Nov-07 23:49 
GeneralRe: How to use ASP.Net with Javascript? Pin
blooper0222-Nov-07 16:07
blooper0222-Nov-07 16:07 
GeneralRe: How to use ASP.Net with Javascript? Pin
blooper0222-Nov-07 21:59
blooper0222-Nov-07 21:59 
QuestionAvoid redrawing flash with postback Pin
Jan Hirak20-Nov-07 23:27
Jan Hirak20-Nov-07 23:27 
AnswerRe: Avoid redrawing flash with postback Pin
Prakash_Mishra21-Nov-07 0:44
Prakash_Mishra21-Nov-07 0:44 
GeneralRe: Avoid redrawing flash with postback Pin
Jan Hirak21-Nov-07 1:04
Jan Hirak21-Nov-07 1:04 
GeneralRe: Avoid redrawing flash with postback Pin
Malcolm Smart21-Nov-07 1:26
Malcolm Smart21-Nov-07 1:26 
GeneralRe: Avoid redrawing flash with postback Pin
Jan Hirak21-Nov-07 2:17
Jan Hirak21-Nov-07 2:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.