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,
Serdar DemirkolApplication Developer & DBAAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EyalCommented:
I don't think it will work. MessageBox is for windows forms and not for web forms
0
Ajay SharmaCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
santhimurthydCommented:
0
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

É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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.