• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 744
  • Last Modified:

ASP.NET System.Windows.Forms.MessageBox

Hi,
Is there any downsides/problems adding a reference to System.Windows.Forms and using MessageBox on an ASP.NET form?

Many Thanks,
0
Serdar Demirkol
Asked:
Serdar Demirkol
  • 5
  • 4
  • 2
  • +2
3 Solutions
 
EyalCommented:
I don't think it will work. MessageBox is for windows forms and not for web forms
0
 
Ajay SharmaCommented:
0
 
santhimurthydCommented:
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Éric MoreauSenior .Net ConsultantCommented:
you just can't. even if you try on your development PC and it appears to work, don't forget that when it will run on the IIS server, that code which is in the code behind and thus will show ... on the server!
0
 
Serdar DemirkolApplication Developer & DBAAuthor Commented:
The reason I want to use Wndows.MessageBox (as it does work); it is easy to take the client response and all happenning on client side.
Does anyone know any better way to take client response other than js alert and confirm as you cannot custimize these two.

Thanks,
0
 
Éric MoreauSenior .Net ConsultantCommented:
in the web world, alert is the way to go!
0
 
santhimurthydCommented:
As you mentioned, to get response in Jaavscript Alert and Confirm are the only two options available. Prompt to ge the value from User.

Take a look in to the below sample with the clear explanation
http://sislands.com/jscript/week1/dialogbox.htm
0
 
Serdar DemirkolApplication Developer & DBAAuthor Commented:
santhimurthyd:

Any ideas of picking the client response by server dinamically?

Thanks,
0
 
santhimurthydCommented:
If you wish to trigger any event on Server side based on User input, that can be achieved by below stesp

i) Create an asp button
<asp:Button ID="Button1" runat="server" Text="Button" Style="display:none" OnClick="Button1_Click" />

ii) Create an event in the code behind

protected void Button1_Click(object sender, EventArgs e)
{
 //Your logical code you wish to do
}

iii) In the javascript

if(confirm("Are you wish to do"))
{
 document.getElementById("<%=Button1.ClientID %>").click();
}

check it out, whether it meets your requirment
0
 
Serdar DemirkolApplication Developer & DBAAuthor Commented:
I have also found below link very useful. Many Thanks

http://www.4guysfromrolla.com/articles/021104-1.aspx
0
 
Serdar DemirkolApplication Developer & DBAAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 250 points for santhimurthyd's comment http:/Q_27480134.html#37243395
Assisted answer: 250 points for santhimurthyd's comment http:/Q_27480134.html#37243502
Assisted answer: 0 points for serdardmrk's comment http:/Q_27480134.html#37244698

for the following reason:

The link I have provided is exactly what I was looking for so everyone has similar issues would find it as the solution.
0
 
Ajay SharmaCommented:
I posted same link in my first post, did you read that comment ???
0
 
santhimurthydCommented:
Thanks serdardmrk for accepting the information and for your points.
0
 
Serdar DemirkolApplication Developer & DBAAuthor Commented:
ajaysharmaapjs:

Sorry (blaming the busy work), this must be where I have found it. I'll correct the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 4
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now