Anand
Anand

Reputation: 3

using gridview inside update pannel and generatring alert

i'm using an gridview inside the update panel.now in that grid i have 3 columns when the values are entered in col 1 and 2 the values must be calculated and the result will display in col 3. now what i want is when the value in col 2 is entered i want an alert msg of showing that u r exceeding the value limit,say if only upto 5000 can be entered the user is entering 6000. ijust want to generate an javascript alert here. how to do this inside the updatepanel. please somebody help

Upvotes: 0

Views: 349

Answers (2)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039328

You could use the RegisterStartupScript method in the callback that is called by the update panel:

ScriptManager
    .RegisterStartupScript(this, GetType(), "alertKey", "alert('error');", true);

Upvotes: 0

Andy West
Andy West

Reputation: 12509

For the column you want to validate, change it to a TemplateField if it's not already. Then you can add a RangeValidator that will do the work for you.

If you then add a ValidationSummary, you can set the ShowMessageBox property to true and get your alert.

Upvotes: 1

Related Questions