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

How to send data from win forms to web using Json?
ef return wrong DateTime in another thread
how to script hosted online database table and procedure programmatically using c#
Bot Framework (.Net) - Retrieving Username of a specific user using the bot at a specific time in Microsoft Teams
TicTacToe Minimax Algorithm Always Returns Lowest Value
Data in Oracle Database table is not being fully updated
Why does my Required property not being cascade deleted in Entity Framework Core?
No parameterless constructor was found on 'TContext'
Split long enum into smaller groups or namespaces [closed]
Matching a string value with a cell with the same or close to same value in an excel spreadsheet
Populate DropDown with Array - AngularJS and C#
How to get connection string out of Azure KeyVault?
Regex - allow characters unless a certain character precedes part of the string?
How to fix HTML source code from simply “return View” in controller in ASP.Net MVC
Why is Page load event not firing?
Is it possible for SemaphoreSlim.WaitAsync().ConfigureAwait(false) to throw?

Categories

HOME
actionscript-3
oop
youtube-api
cluster-analysis
ldap
wifi
azure-eventhub
magento-1.9.2.1
where
squeak
mailchimp
thermal-printer
sugarcrm
jshell
collision-detection
adroitlogic
minimum
popup
sha1
passbook
gnu-screen
ng-tags-input
screen-scraping
android-wear-2.0
waterfall
sasl
akavache
dynamics-ax-2012-r3
arp
wercker
kubectl
voyager
asp.net-webhooks
realloc
kepserverex
redhat-brms
motion
jquery-inputmask
azure-web-roles
vertical-alignment
jvisualvm
smooth-streaming
taleo
mef
multivalue
ear
ajv
aot
codesniffer
rmq
nls
vertex-shader
huawei
sharing
timefield
mongodb-3.3
jspx
scriptengine
jigsaw
falcon
nd4j
clique
stdlist
music-player
skbio
bluetooth-lowenergy-4.2
computability
jsoncpp
avrcp
dcg
eula
targetprocess
asp.net-2.0
nexusdb
teamstudio-unplugged
xcode5
javadb
system.io.packaging
xmlserializer
dateadd
pthreads-win32
mixradio
flask-mongoengine
dylan
ojb
listpicker
database-restore
correctness
linear-interpolation
expresso-store
big-endian
socketasynceventargs
jqueryi-ui-buttonset
cgaffinetransform
cherokee
httppostedfilebase
openwrap
backlight
cpack
norton
webdb
konsole
hp-trim
pixel-bender
ihtmldocument2

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