c#


alert box from asp.net 3.5 Code-Behind


protected void ddlLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlLanguage.SelectedValue=="es-ES")
{
Page page = HttpContext.Current.CurrentHandler as Page;
page.ClientScript.RegisterStartupScript(typeof(Page), "Script", "<script language='javascript'>alert('All content may not be in Spanish. Do you want to continue...');</script>");
}
}
All I want to do is display a simple alert box but all in vain...nothing pops-up. need some ayudar.
You can also achieve in this way
protected void ddlLanguage_SelectedIndexChanged(object sender, EventArgs e)
{
if (ddlLanguage.SelectedValue=="es-ES")
{
Response.Write("<script>alert('All content may not be in Spanish. Do you want to continue...');</script>");
}
}
You need to verify if the startup script is not registered already. Check out this post.
Also you can build your custom MessageBox in ASP.NET. Check out this one.
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "showalert","Alert Message", true);
This works for me without Postback
try this

Related Links

Issue with newid() after dropping table constraints using t-sql
How I can Recover sorted data in a Grid View using C#?
On a Windows machine is there a way to programmatically find out which application is responsible for opening files with a particular extension?
Observable return collection of collection
C# Compiler Parameters - metadata could not be found
CSSFriendly - Issue using CSSFriendly when same menu control is added as a reference in other pages
Call vc++ dll in c# by .def file(by ordinal no's)
Autopostback in c# code while keeping several textboxes and dropdownlists values
How can I give a WCF service more time to complete after it times out?
ImageSource for Icon property must be an icon file - Embedded Resource
How do you insert HTML into a C# Program? [closed]
Is it safe to load a partial view which gets its name from route parameter in ASP.NET MVC?
Unable to send mail from ASP.NET web page
How to copy images in one folder to another folder using c#? [duplicate]
get dsa signature value in octect string
using DTO with WCF

Categories

HOME
internet-explorer
postgresql
macros
intellij-idea
ssh
grpc
opc-ua
servicenow
ephesoft
http-status-codes
background-image
tag-cloud
loss
multibinding
wallet
beacon
pushbullet
inline-assembly
rvm
aws-certificate-manager
oracle10g
angular2-changedetection
bytebuffer
arp
foxpro
spring-oauth2
snapkit
node-soap
traitsui
javax
intersection
ponylang
hippocms
abide
usernotifications
pyexcel
grails-2.0
xmldom
evaluation
ear
beanshell
fckeditor
acceleo
firebase-polymer
indoor-positioning-system
foreground
tinybox2
hotkeys
nslocalizedstring
maven-antrun-plugin
gulp-cdnizer
libgcrypt
php-gd
pushwoosh
tess4j
azure-mobile-app
firewire
eula
waterline
ultraedit
chrome-mobile
indices
report-builder2.0
system.io.packaging
mind-manager
register-allocation
webshim
code-smell
xps
mongoid4
db2-connect
thucydides
mencoder
xrandr
cocotron
bho
servicemanager
nsregularexpression
xcode4.6.3
diazo
datasheet
motorola-droid
utm
hs-err
miniport
datadude
manuals
authkit
zend-acl
opengl-to-opengles
software-update
cons

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App