Web Forms :: Display Server Side Yes No Confirmation Box On DropDownList Change

Apr 16, 2013

I was wondering if there is a way to capture the yes/no values on the server side once the y/n buttons are clicked on a javascript pop up?

I am displaying the y/n pop up while using a dropdown menu but pretty much all the solutions i have seen so far use button's onClick event.

By reading article: [URL]

I am able to see the pop up box with the yes/no options but after i click a 'yes' or 'no', i don't see  'You clicked Yes' or 'You clicked No'.

This is the code i have so far which has been taken from Muddassar's article that uses a button, not a drop down.

I can see for button the "Confirm()" is being called by OnClientClick event, but i haven't been able to make it to work in a dropdown.

On the aspx page:

<asp:DropDownList ID="ddlWorkBucket" runat="server" AutoPostBack="true" DataSourceID="SqlDataSource8" DataTextField="workBucketName" DataValueField="workBucketID" Width="120px" onChange="Confirm()" OnSelectedIndexChanged="OnConfirm"></asp:DropDownList>

Also on the same aspx page is this javascript function:

 <script language ="javascript" type="text/javascript"> 
function Confirm() {    var confirm_value = document.createElement("INPUT");   
confirm_value.type = "hidden";    confirm_value.name = "confirm_value";   

[CODE].....

View 1 Replies


Similar Messages:

Web Forms :: Display Server Side Yes No Confirmation Box On DropDownList SelectedIndex Changed

Apr 29, 2014

 I am trying to use Yes No Confirmation Message Box but the code below here which i found here uses a button to raise the confirmation message box but what i would like to use is a DropDown.  How can i modify the code and i use drop-down box instead of using a button? here is the javascript code: 

<script type = "text/javascript">
function Confirm() {
var confirm_value = document.createElement("INPUT");
confirm_value.type = "hidden";
confirm_value.name = "confirm_value";

[code]....

but here is what i would like to use is drop-down instead of the button:

<div>
<asp:DropDownList ID="ddl" Width="300px" runat="server" AppendDataBoundItems="true" OnSelectedIndexChanged="ddl_SelectedIndexChanged">
<asp:ListItem Text="test1" Value="test1"></asp:ListItem>
<asp:ListItem Text="test2" Value="test2"></asp:ListItem>
<asp:ListItem Text="test3" Value="test3"></asp:ListItem>
</asp:DropDownList>

</div>

View 1 Replies

Web Forms :: Display Confirmation Message From Server Side

Mar 11, 2010

On a check box check changed I want to test some conditions and based on that I want to display a confirmation message. Based on the user action, OK or Cancel I want to proceed or stop the process. How can I do that. I tried this,

[Code]....

Even I click Cancel the rest of the code also executed. How can I handle this?

View 3 Replies

Web Forms :: Assigning Confirmation Dialog Frm Server Side?

Jan 7, 2010

is it possible to assign the YES/NO or YES/CANCEL dialog frm server side & how to code for it.

View 12 Replies

Web Forms :: Server Side Yes No Confirmation On Page Load

Jan 24, 2016

The article described fine work on Button Click But I want to use On page Load [URL] ....

View 1 Replies

Alert - Confirmation Box From Server Side?

Feb 25, 2011

I want to show the confirmation box in asp.net from server side:I want to call it from server side because I have to take the customer message from server side. I am using the below code

string str = "Are you sure, you want to Approve this Record?";
ClientScript.RegisterStartupScript(typeof(Page), "Popup", "return confirm('" + str + "');",true);
// More code ....

Now it is showing the popup and irrespective of what I click, whether "ok" or "Cancel", my code is executing. let me know how can I restrict code to be executed when user select "cancel" in the confirmation box.

View 2 Replies

AJAX :: Server Side Confirmation - Not Control Initiated

Sep 25, 2013

URL...In the above page, the button fires the javascript first, then the code-behind sub runs.  The problem I have is I am in the middle of a code-behind sub routine that checks if a user is logged on the a PC.  If there is a users logged on, I want the confirm popup to ask whether to reboot anyway or cancel.  The code needs to dictate whether to call the javascript, not some direct button click.  Then I need the remainder of the code-behind sub to execute based on the users choice. 

I can call the client script in the code-behind sub using 'RegisterStartupScript...'; then I can get the page's form value.  The problem is that the sub runs to completion without waiting for the javascript code to run.  This causes code-behind variable to get checked before it's set by the client and it nevers works.

View 1 Replies

How To Get Return Value Of JQuery Confirmation Dialog From Server Side Code

Nov 15, 2015

I have JQuery confirmation dialog function that called by server side code (C#)how to get its return value of that function? in this case the return value would be either Yes or No.I called it in button clicked event as below:

Code:
protected void btn1_Click(object sender, EventArgs e)
{
string message = "Message from server side, please select yes or no";
ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowConfirmation('" + message + "');", true);
}

my question is how to get JQuery return value, in this case the return value would be Yes or No?

Code:
=== JQuery Confirmation Dialog ==
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"

[code]....

View 1 Replies

AJAX :: Show Server Side Yes No Confirmation Box Using Script Manager

Feb 5, 2014

I am throwing a alert box using scriptmanager like this based on some condition.

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Would you like to be put on the wait list?')", true);

But it has only "ok" button. Is there a way to display a message box which has yes/no buttons so that I want to check some more conditions in the code behind.

something like this.

DialogResult result = MessageBox.Show("Do you wanna do something?", "Warning",
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
if(result == DialogResult.Yes) {
//code for Yes
} else if(result == DialogResult.No) {
//code for No
} else if (result == DialogResult.Cancel) {
//code for Cancel
}

View 1 Replies

Web Forms :: Change Tab Attributes In Server Side Code?

Nov 7, 2010

I'm emulating tabpages with this code in my aspx:

[Code]....

In server-side I have this code:

[Code]....

In my page_load, how can I change the attributes of the tabs?

View 2 Replies

Forms Data Controls :: Adding Client Side Confirmation When Deleting?

Aug 10, 2010

I am unable to firgure out what is referred to by "Northwind.ProductsRow" in the following code snipet:

[Code]....

I am abble to wrangle the code to work with a generic message but without understanding this piece I am unable to figure out how refrence my own data.

View 8 Replies

Web Forms :: Add Client - Side Javascript Confirmation Dialog To Form With .net Validation Controls?

Dec 9, 2010

Is there any way to add a confirmation dialog to a submit button when the form already has other validation controls and a summary control using "showmessagebox=true"? I tried adding

OnClientClick="return confirm('Are you sure?');" to the submit button, but that seems to block all of the other validation?

View 3 Replies

Forms Data Controls :: GridView Client Side Confirmation CommandField, ObjectDataSource?

Apr 22, 2010

[Code]....

GridView Client Side Confirmation CommandField, ObjectDataSource?

View 14 Replies

Forms Data Controls :: Change SelectedValue Of Html Select From Server Side

Mar 20, 2010

after trying alot and searching here and there i decided to post it here. I have my aspx page. at the top pf that page a html header is included, that html header contains a html select control with runat="server". i populated it with dataset, i also implimented onserverchange even successfully. no on my main aspx page i have anothe asp dropdownlist control. what i want is that whenever dropdownlist server selected index changed the value of html select control in my header also chang. I code in dropdownlist_selectedindex change like this

htmlselectcontrol.Value=dropdownlistcontrol.selectedValue.

but value of htmlselect control remains unchanged.

View 14 Replies

Web Forms :: Display Cache Data Only Instead Of Server Side Code

Feb 7, 2011

I am working on page where data will update in every 10 second by scraping data from other Stock website. So basically page is displaying stock data which update in every 10 seconds. I am using update panel and timer control. Now problem is that if 100 users open the webpage 100 request go server in each 10 seconds. I want to implement Cache on page where Cache version of page serves to other user. I am using <%@ OutputCache Duration="10" VaryByControl="Timer1" %> but when event occur code run intends of delivering Cache version of page. What I am doing for test.

1) Open page in different browser in local

2) Checking browser type using code

Dim s As String = ""
With Request.Browser
s &= "IP = " & HttpContext.Current.Request.UserHostAddress & vbCrLf
s &= "Browser Name = " & .Browser & vbCrLf
End With
Label1.Text = s

if page first open in IE then if I again open in firefox it shows browser type IE but after 10 sec interval it will update type to firefox. So I want to display Cache data only instead of executing server side code for each different browser.

View 1 Replies

Forms Data Controls :: Change Formatting Of Text In TextBox Via Server-side TextChanged Event

May 6, 2010

I have a series of textboxes on a FormView. There is a textbox for entering a percent for a deposit amount and next to that a corresponding textbox for entering a dollar value for a deposit amount. There are 3 sets of these.

If a user changes a percent textbox, I update the dollar value textbox based on the percent times the project's total cost. If a user changes the dollar value textbox, the percent textbox gets updated as a percent of that dollar amount divided by the project's total cost.

I have the percent textboxes formatted as "{0:0%}" and the dollar value textboxes as "{0:C}".

When a user types into the textbox, the formatting goes away and we get raw numbers but I don't want those raw numbers to remain as such after they tab or click out of the field. I added a TextChanged event to reset the formatting. This works fine on reformatting the percent textbox but the currency one remains as just a raw numeric value.

Here is the markup (ignore the lack of validation for numeric input only...it will be added):

<td>
<asp:TextBox ID="txtDepositPercent1" runat="server" AutoPostBack="true"
CssClass="TextboxAnimatedRightAlign" Width="33px"
Text='<%# String.Format("{0:0%}", Eval("fld_dep1")) %>'
OnTextChanged="txtDeposit_TextChanged" />

[Code]....

View 5 Replies

C# - Client-side Confirmation On Gridview Does Not Work?

Jun 24, 2010

In my project, In gridview i want to add a client-side confirtmation for deleting a record. Everything seems right, browser asks for confirmation, after pressing "yes", nothing happens in gridview as well at database. What's the missing point ? Also in gridview, after pressing edit button "ArgumentOutOfRangeException was unhandled by user code" exception occurs

<asp:GridView ID="grid1" runat="server" DataSourceID="sqlSource1" DataKeyNames="id"
AutoGenerateColumns="false"
BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"
CellPadding="3" ForeColor="Black" GridLines="Vertical" OnRowDataBound="grid1_RowDataBound">
<Columns>
<asp:CommandField ShowDeleteButton="true" ButtonType="Image" DeleteImageUrl="~/Images/delete.gif" />
<asp:CommandField ShowSelectButton="true" ButtonType="Image" SelectImageUrl="~/Images/select.gif" />
<asp:CommandField ShowEditButton="true" ButtonType="Image" EditImageUrl="~/Images/edit.gif" UpdateImageUrl="~/Images/update.png" CancelImageUrl="~/Images/delete.gif" CausesValidation="false" />
<asp:BoundField DataField="id" HeaderText="Company ID" />
<asp:BoundField DataField="name" HeaderText="Company Name" />
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCCCCC" />
</asp:GridView>
protected void grid1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton del = (ImageButton)e.Row.Cells[0].Controls[0];
del.OnClientClick = "return confirm('Are you sure to delete ? ');";
}
}

View 1 Replies

Web Forms :: Display Confirmation Dailog Box?

May 20, 2010

So Now I want put a confirmation box for my button click.

like "Are you want to Procesed" Yes NO CANCEL(Buttons)

If I click YES only my code should work or else can't

Iam Using ASP.Net 2.0 and VB.NET

View 5 Replies

Change Server Side Use To HTML Image Tag Only

Oct 4, 2010

I am trying to wire some fancy Javascript (PopBox) to an ImageButton control and I am getting a very strange run-time (Compilation) error.

<asp:imagebutton id="imgBtnPicture" runat="server"
class="PopBoxImageSmall"
pbshowcaption="true"
title="Click to magnify/shrink"
onclick="Pop(this,50,'PopBoxImageLarge');"
width="90%">
</asp:imagebutton>

I've looked at replacing the ImageButton web control with a simpler HTML img tag (which is what the PopBox documentation suggests). Yet, I don't know how to populate an <img> tag from the CodeBehind file. Here is a typical statement which sets the .SRC property from an ASP.Net dataset row:

Me.imgBtnPicture.Src = theRow.Item("ImageURL")

I've tried this as an alternative:

<img alt="" src=""
id="imgPicture" runat="server"class="PopBoxImageSmall" title="Click to magnify/shrink"
onclick="Pop(this,50,'PopBoxImageLarge');" width="90%"
/>

Visual Studio 2008 does not complain about this declaration above but in the codebehind file, how would I address this so I could populate the .Src attribute.

Intellisense, cannot even "see" this
Me.imgPicture.src = theUrl 'this won't compile...

I added this at the top of the codebehind but seemed to have no effect:

Imports System.Web.UI.HtmlControls

View 3 Replies

Change AspxGridView Mode On Server Side

Mar 21, 2011

I want to change AspxGridView mode on server side. For example :

if( some clauses)
{
// Mode is : New row
}
else if (some clauses)
{
// Mode is : Edit row
}

View 1 Replies

C# - Set Parent Dropdownlist Of CascadingDropDown On Server Side?

Nov 2, 2010

I have have 2 DropDownList controls with CascadingDropDown

I need set data to the first dropdownlist on server side if i do this, and when i get page on client side, the first DropDownList without data that i set on server side

//client
<asp:DropDownList ID="ddlAjaxManufacturer" runat="server">
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDownManufacturer" runat="server"
TargetControlID="ddlAjaxManufacturer" Category="Make" PromptText="....." ServicePath="../../Ajax.asmx"
ServiceMethod="GetMakes" />
<asp:DropDownList BackColor="white" ID="ddlAjaxModel" runat="server">
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDownModel" runat="server" TargetControlID="ddlAjaxModel"
ParentControlID="ddlAjaxManufacturer" PromptText="....." ServiceMethod="GetModelsForMake"
ServicePath="../../Ajax.asmx" Category="Model" />
//server
ddlAjaxManufacturer.Items.Add(new ListItem("...", "", true));
ddlAjaxManufacturer.Items.Add(new ListItem("11", "ford", true));
ddlAjaxManufacturer.Items.Add(new ListItem("22", "bmw", true));

View 1 Replies

AJAX :: TabContainer - Run Server Side Function On Tab Change

Jan 24, 2010

As far as I can see there are only client events on this container, and I need to update a gridview when the user changes tabs.

View 2 Replies

C# - Set Dropdownlist Item Text Using Server Side Method?

May 13, 2010

I am trying to set the Text property of a drop down list option like this:

<asp:ListItem Value="AB" Text='<%= Resources.Get("USA") %>'></asp:ListItem>

But it isn't working, instead the Text value is literally <%= Resources.Get("USA") %> and not the string "USA".

i.e. it is not being interpreted as code.

View 2 Replies

Web Forms :: Display Loading Progress Bar After Validation And Confirmation

May 7, 2015

I have read the solution provided : [URL] ....

For Progress Bar with validations..... It's working good...

Additionally i need to prompt a Confirm dialog box on button click with some custom message as "Are you sure?" . If user click on cancel nothing would happen but if clicks on OK then should first check all validations, if it's passed all then should display progress bar, If not passed then validators should raise message for corresponding fields.

On this page i have used AJAX TOOLKIT also.

Here's my code below as a sample:

.aspx code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="loading.aspx.vb" Inherits="loading" %>
<%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" tagPrefix="ajax" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">

[Code] ....

.VB CODE:

Imports System.Configuration
Partial Class loading
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
t1.Visible = False

[Code] ....

View 1 Replies

Web Forms :: Display Confirmation Message Box On TextChanged Event Of TextBox

Dec 12, 2013

I want to cheate confirmation msg box when user chane the date of text box "You changed the date do you want to proceed yes or no" ....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved