473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Message box alert in javascript through c#?(ajax technology)

nirmalsingh
218 100+
i have an html form ,web form and javascript file.(using ajax technology), html page is start up page , server side codings are written in web form. now the problem is i want to display message in html form by calling javascript function through c# ( ie:web form). i have tried
string jscript = "<script language='javascript'>hallo();</script>";
Page.RegisterClientScriptBlock("keyClientBlock",js cript);
but i cant get result. plz help me...
Dec 21 '06 #1
2 14384
b1randon
171 Expert 100+
i have an html form ,web form and javascript file.(using ajax technology), html page is start up page , server side codings are written in web form. now the problem is i want to display message in html form by calling javascript function through c# ( ie:web form). i have tried
string jscript = "<script language='javascript'>hallo();</script>";
Page.RegisterClientScriptBlock("keyClientBlock",js cript);
but i cant get result. plz help me...
You will need to move this to the .net forum as your question has to do with the .net code. Unless you think the problem is with your javascript. This is one reason that I don't really like the way .net hides what is done on the client and what is done on the server. It is making it harder to identify where your problem lies. If you think the problem is in your javascript you should post only the HTML and Javascript source of the page, minus the .net code.
Dec 21 '06 #2
AricC
1,892 Expert 1GB
I think something like this is what your looking for,

public static void ShowMessage(Page aPage, string aMessage)
{
aPage.RegisterStartupScript("AlertMsg", "<script language='javascript'> alert('" + aMessage + "'); </script>");
}


Here are some other examples to help. I do think you will get more replies in the .Net forum as stated above.



Note: Did you hijack Killer42's avatar? ---------------------------------->
Dec 22 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: schieco | last post by:
The following code always prints the debug lines inside the conditional if statement before and after the alert statement when the session has timed out, but the alert and redirect only appear/work...
7
by: giangiammy | last post by:
hi all, I need to implement a web page with a table: the page structure i fixed, the tables field are updating from time to time. The table could be quite big, but just some fields change...
8
by: jpaul | last post by:
Hi I am very new to this two If the browser disable the javascript, what happen to Ajax? can i slove the problem by using server side script? any suggestion for this? i currently do some dirty...
1
nirmalsingh
by: nirmalsingh | last post by:
i have an html form ,web form and javascript file.(using ajax technology), html page is start up page , server side codings are written in web form. now the problem is i want to display message in...
3
by: Jeremy | last post by:
I've got a button in an update panel. In the click event of the button (server side code), I perform some logic and under certain criteria I want to display an alert to the user. I've tried...
1
by: kaj28121980 | last post by:
I have a typical senario. My Web component provides action for database backup and restore. while user wants to backup or restore database the user is logged out and redirected to the login page and...
1
by: David | last post by:
Hi all, I am using AJAX in my app. I have a button that is updating the database, but when I click the button, I am not getting any feedback (normal (no ajax) would post back the page, which...
22
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created...
1
by: David C | last post by:
I have an ASP.Net page that uses Ajax on a FormView. Prior to Ajax, I had a Javascript alert() box pop-up to inform the user that update was successful. Now that the Postback does not occur, how...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.