AJAX :: ModalPopupExtender.Hide() And Executing Other Code In Codebehind?

May 1, 2010

In a button click, I need to be able to hide my ModalPanel and then continue running other code server-side. I currently have it this way:

[Code]....

It hides the panel at the of the event handler because that's when the page posts back. So what can I do to hide the panel and then continue running the rest of the server-side code?

Basically what I'm trying to do is the following:

1. Button_display in my webform simply displays my UpdatePanel via ModalPopupExtender.

2. Button_closePanel_Click will hide my UpdatePanel and then run some server-side code, which would display my UpdateProgress control.

protected void Button_closePanel_Click(object sender, EventArgs e)

View 2 Replies


Similar Messages:

AJAX :: Executing Code Behind After Closing ModalPopupExtender?

Oct 27, 2010

It is possible to execute code behind in parent just after closing ModalPopupExtender ?

View 2 Replies

AJAX :: ModalPopupExtender To Popup After Executing An Event?

Jul 7, 2010

In the save button click I have the following code.

[Code]....

[Code]....

ModelPopupExtender pops up immediately after clicking the Save button without executing AddClient.How do I make it to pop up after AddClient has been executed?

View 8 Replies

AJAX :: Executing A Page Method In (dynamically Loaded) WebUserControl Codebehind

Nov 18, 2010

Im loading a popupextender (its in a WebUserControl)via LoadControl dynamically in to page. how can I force to run a page method when I click OK button in WebUSerControl? simply type casting of page like (_DefaultPage)Page.Calculate() doesnt working.

[Code]....

View 1 Replies

AJAX :: ModalPopupExtender Preventing Codebehind Event From Firing?

May 21, 2010

Here is what I'm trying to do: Click a button on my page, which in turn makes (2) things happen:Display a ModalPopup to prevent the user from pressing any buttons or changing valuesCall my code behind method, hiding the ModalPopup when finished Here is the ASP markup:

[Code]....

popup is ALWAYS equal to null.

View 10 Replies

AJAX :: How To Hide The Modalpopupextender

Mar 15, 2010

in my c# code i have the following;

ModalPopupExtender2.Show();

This works fine my popup appears, so i put an ok button on the Panel and on_click in the code file i tried to;

ModalPopupExtender2.hide();

But it dosent work - nothing happens. I dont have it in an update panel.

View 1 Replies

AJAX :: ModalPopUpExtender Won't Hide After Click The Button

Apr 5, 2010

So I have a master page and a child page with ModalPopUpExtender.

When I click a button on child page, the button will call this "ModalPopUpExtender.Show()", but when I click on the button targeted by the CancelControlID, the ModalPopUpExtender won't hide.

If I create a new project without the master page, the code works fine.

View 2 Replies

AJAX :: Hide Button In Panel For Modalpopupextender?

Feb 14, 2011

I have a panel displayed using modalpopupextender, which contains buttons that i want to hide before results are displayed.

However, using button.visible=false cannot work. I do not know the reason for it. Do anyone know how to hide the buttons in the panel for modalpopupextender?

View 3 Replies

AJAX :: ModalPopupExtender Won't Hide After Response.Write With Excel

Aug 18, 2010

I am having a great deal of difficulty getting a ModalPopupExtender to hide after I export a datatable to Excel.

If I simply rem out the Response.write in the code below, everything works correctly, but of course I don't get my excel sheet.

I have tried all kinds of ways to do this. Including calling a javascript function to hide it, wrapping the Panel in an updatePanel and placing the TransactionControl in a asp:PostBackTrigger.

All without affect. Anyone have a clue as to how to do this?

I was also hoping some event would fire after the ModalPopupExtender hides, but of course there is no such luck.

[Code]....

View 1 Replies

AJAX :: Executing Code From Js Pagemethods?

Jul 15, 2010

I wrote a code to call some event...

[Code]....

and

[Code]....

js calls this code and I get object reference not set to an instance of an object

View 7 Replies

C# - Executing A Javascript Function From Codebehind?

Nov 3, 2010

OK, this feels like a question that should be easy to answer, but as with so much mixing of asp.net and jQuery, it's a bit of a nightmare.

What I want to do is be fading a div in and out at various times during the client's viewing of my asp.net page; I fade it out using jQuery's fadeTo() before triggering an UpdatePanel update (to indicate that the data there is not fresh) and I want to fade it in again once the UpdatePanel has been updated. I've gotten as far as updating the UpdatePanel in the codebehind, and this results in the div's content changing... but how do I fade the div back in again?

The way I see it, there are 2 ways; register an event handler on page load to detect when the div's content has been changed and fade it back in, or call a function from the asp.net codebehind when I've updated the div to fade it back in.

In the first case, there doesn't seem to be any event triggered by the div's content changing, so I can't seem to do that. If anyone knows how I could get a client event to trigger when I update the div, that would be a nice solution.

In the second case, I thought that this was what ClientScriptManager was for, but it doesn't quite do what I want. I want to be able to register a particular Javascript function with ClientScriptManager and then tell ClientScriptManager to execute it in the client, from my codebehind. You can't seem to do that. ClientScriptManager.RegisterClientScriptBlock() simply inserts some <script> into the HTML output, rather than calling a function. Presumably this would work if I kept registering things like:

<script>fadeBackIn();</script>

because the Javascript would be immediately evaluated and run, but this feels messy, and that feeling is intensified by the fact that I'd have to keep randomly generating a new unique value for the key argument of ClientScriptManager.RegisterClientScriptBlock(), because it's specifically designed to stop this kind of repeated code. However, I'm struggling to see an alternative.

I'd really like something along the lines of:

ClientScriptManager.RegisterClientScriptFunction("fadeBackIn", "function fadeBackIn(){ ... }");
ClientScriptManager.ExecuteClientScriptFunction("fadeBackIn");

View 4 Replies

AJAX :: Server Code Executing Twice With Control Toolkit

Jan 24, 2011

I am using following server side code to save the data from ASP.NET Control toolkit Editor to the database It follows with the HTML Code The problem is that, data is saved successfully. But it is saved twice. Main problem is this server side event is fired twice. How can i prevent it from firing twice?

Server side code
Imports System.Data.SqlClient
Partial Class Administrator_Calendar
Inherits System.Web.UI.Page
Protected Sub BtnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnAdd.Click
Try
Dim dbobj As New db
Dim i As Integer = 0
Dim rdr As SqlDataReader = dbobj.selectQuery("select max(srno) from calendar")
If rdr.HasRows = True Then
rdr.Read()
i = rdr.Item(0)
End If
rdr.Close()
dbobj.insertQuery("insert into calendar values (" & i + 1 & " , '" & Me.Txt_dt.Text & "' , '" & Me.Editor1.Content & "')")
dbobj = Nothing
Catch ex As Exception
End Try
End Sub
End Class
HTML CODE
<%@ Page Language="VB" MasterPageFile="~/MasterPages/Admin_AftrLogin.master" AutoEventWireup="false"
&nbsp;&nbsp; &nbsp;CodeFile="Calendar.aspx.vb" Inherits="Administrator_Calendar" Title="Excel Crop Care Ltd. / Administration Section / Manage Calendar..." %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor"
&nbsp;&nbsp; &nbsp;TagPrefix="cc2" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
<div>
<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0">
<cc1:TabPanel runat="server" HeaderText="Selected Dates" ID="TabPanel1">
<ContentTemplate>
<asp:GridView ID="Gridview1" runat="server" AutoGenerateColumns="False" DataKeyNames="srno"
DataSourceID="SqlDataSource1">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True">
<ItemStyle Width="20%" />
</asp:CommandField>
<asp:BoundField DataField="srno" HeaderText="No." ReadOnly="True" SortExpression="srno">
<ItemStyle Width="10%" />
</asp:BoundField>
<asp:BoundField DataField="date" HeaderText="Date" SortExpression="date">
<ItemStyle Width="30%" />
</asp:BoundField>
<asp:BoundField DataField="description" HeaderText="Description" SortExpression="description" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%&#36; ConnectionStrings:DataConnectionString %>"
SelectCommand="SELECT * FROM [calendar]" UpdateCommand="Update calendar set date=@date,description=@description where srno=@srno"
DeleteCommand="Delete from calendar where srno=@srno"></asp:SqlDataSource>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Add New">
<ContentTemplate>
<table>
<tr>
<td width="30%">
Date :
</td>
<td>
<asp:TextBox ID="Txt_dt" runat="server" Height="16px" Width="170px" CausesValidation="True"
Font-Names="Verdana" ForeColor="#666666"></asp:TextBox>
<asp:ImageButton runat="Server" ID="Image1" ImageUrl="../Images/Calendar_scheduleHS.png"
AlternateText="Click to show calendar" /><br />
<cc1:CalendarExtender ID="Txt_dt_CalendarExtender" runat="server" DaysModeTitleFormat="dd/MM/yy"
Enabled="True" Format="dd/MM/yy" TargetControlID="Txt_dt" PopupButtonID="Image1">
</cc1:CalendarExtender>
<cc1:TextBoxWatermarkExtender ID="Txt_dt_TextBoxWatermarkExtender" runat="server"
Enabled="True" TargetControlID="Txt_dt" WatermarkText="DD/MM/YY">
</cc1:TextBoxWatermarkExtender>
<cc1:MaskedEditExtender ID="Txt_dt_MaskedEditExtender" runat="server" MaskType="Date"
CultureDateFormat="dd/MM/yy" Enabled="True" TargetControlID="Txt_dt" Century="2000"
UserDateFormat="DayMonthYear" Mask="99/99/99">
</cc1:MaskedEditExtender>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="Lbl_msg" runat="server" Text="Enter description in the editor below :"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<cc2:Editor ID="Editor1" runat="server" Height="350px" />
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="BtnAdd" runat="server" Text="Add" OnClick="BtnAdd_Click" Width="75px"
CssClass="btn" />
<asp:Button ID="Btn_Rem" runat="server" Text="Remove" OnClick="BtnAdd_Click" Width="75px"
CssClass="btn" />
</td>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
</div>
</asp:Content>

View 1 Replies

AJAX :: ModalPopupExtender Don't Show Panel By Code

Aug 31, 2010

I am trying to do a simple thing using asp.net. I wanna show a modal popup panel from a server procedure with vb.net.

The error is: The popup donīt show when I click cmdTest Button.

OBS: I used cmdTest just to call the procedure. In my project, one button call a procedure that will or not call other procedure that will or not show the panel.

whatīs wrong with the following code ?

-- aspx --

[Code]....

-- css --

[Code]....

-- vb --

[Code]....

View 3 Replies

AJAX :: Fire Off ModalPopupExtender In The Middle Of A Code Block?

Aug 4, 2010

I have the need to fire off a modal pop-up inline. I have a modal panel defined, and works when I click a test button on the page. Unfortunately I need it to work like this:

1.) A user clicks a 'Save' button

2.) In the code block for that button's Click event, there is a check for a certain constraint.

3.) If that constraint exists, I need to show the modal pop up and determine if the following code in the Click event is executed based off of the return of that modal pop up.

Easily accomplished using a Forms message box. But this is an ASP.net app. What I've tried so far is creating a button that uses a style with "display: none" and programmatically firing off that hidden button's click event. Unfortunately the code does execute but no modal pop up is displayed and the code continues to execute.

View 4 Replies

AJAX :: Run Javascript Code Programmatically In Vb.net Asp Codebehind?

Mar 18, 2011

I have a modalpopupextender that I want to run based on a timer control. I've tried using the clientregisterscript to run some javascript code to perform a fake click on the link control that initiates the modalpopup, but with no luck. What is the best way to either show the modal dialog programatically or register a jscript that will do this.

View 2 Replies

AJAX :: How To Show A ModalPopupExtender Triggered By A GridView Button From Server-side Code

Jul 8, 2010

I have a gridview that displays items awaiting supervisor approval. The supervisor clicks the Review button and a modal window should popup with the results of a database query on the record. I am using a dataketname param on the grid. Here are the ASPX elements, The gridview and the modalpopup code

[Code]....

I am using mpeApproval.Show() in the codebehind but it isn't firing. I've been at this literally all day and am feeling pretty stupid at the moment. Have I provided enough for you to make a determination?

View 9 Replies

AJAX :: ModalPopupExtender / Datalist Original Image Come In Modalpopupextender After Click

Apr 14, 2010

I have a DataList that contains some Thumbnail Image(Image Button).

Now I want when i click on any Item in datalist the original image come in modalpopupextender.

How I can do this?

<asp:DataList
ID="dlImgGallery"
runat="server"
RepeatColumns="3"
Width="100%"
onselectedindexchanged="dlImgGallery_SelectedIndexChanged"
DataKeyField="Id"
>
<ItemTemplate> <table
style="width:100%;">
<tr>
<td
></td>
<td
class="style3">
<asp:ImageButton
ID="ImageButton1"
runat="server"
ImageUrl='<%# Eval("Img_URL") %>'
BorderColor="#0098DB"
BorderStyle="Double"
BorderWidth="3px"
onclick="ImageButton1_Click1"
/>
</td>
<td
class="style3">
</td>
</tr>
</table> <br
/>
<cc1:ModalPopupExtender
ID="mpe"
runat="server"
BackgroundCssClass="ModalBackColor"
TargetControlID="ImageButton1"
PopupControlID="Panel8"
CancelControlID="btnCancel"
ondatabinding="mpe_DataBinding">
</cc1:ModalPopupExtender>
</ItemTemplate>
</asp:DataList>and
my panel that shows as modalpopu
<
asp:Panel
ID="Panel8"
runat="server"
onload
="Panel8_Load">
<asp:Button
ID="btnCancel"
runat="server"
Text="Cancel"
/>
<br
/>
<asp:Image
ID="Image1"
runat="server"
Height="102px"
Width="124px"
/>
</asp:Panel>

Now where I can to write code that when i click on item in datalist Original Image show in modal popup extender?

View 3 Replies

AJAX :: ModalPopUp Show And Hide From Code Behind?

Feb 10, 2010

I have a column within my gridview that displays status of the records. Certain records we need to prompt for additonal information and confirmation so we are using a modalpopup, but other records dont need the popup, so how can i disable or prevent the modalpopup from opening for those records?

Here is my template column for that field:

[Code]....

within my onclick="hypHT_Click" event im doing a simple modalpopup.Show(); how can i check the gridview in order to determine if i need to show it or just disable it.

View 1 Replies

AJAX :: ModalPopupExtender -- Fetch Data In Modalpopupextender

Apr 7, 2010

I would really appreciate if someone can find out what's wrong with this code.

Here is my question. I have textboxes in a modal popup extender (City, state, zip) and there is an image button search for searching the address from the database. All this functionality is within a control (.ascx file). This control is added to the page where it needs to be displayed and is being displayed when a user click the Address button (the code for it is not shown here). The method ShowAddressSearch() in the control is being called from the page and it displays the popup.

When the user enters any of the 3 values and hits search a server event is fired up and the result should be displayed in a grid. What is happening is, when the user hits the search button the server call is made and the data fetched from the db but the modal popup closes itself here is the code for this. I would really appreciate if someone can find out where and how popup is getting closed.

[Code]....

View 1 Replies

Hide Color Code From Textbox Used In Ajax Colorpickerextender At Load Time?

Jul 31, 2010

I am using ajax colorpickerextender control for color selection. For TargetControlID, I have used a textbox. It shows hexadecimal color code into that textbox. Using this post I have resolved this for colorselection change event. I am saving selected color into an xml file and reassigning it to the color control when form loads. My problem is at loading it shows hexadecimal code.

View 2 Replies

Web Forms :: Show Hide Controls At Page Load From Codebehind?

Nov 23, 2010

Is there a way to show/hide (visible = true/false) a textbox and/or dropdownlist at PageLoad (or other Page cycle) from codebehind (I would like to check for some permission regarding current user and show/hide some controls from aspx page) ?

View 2 Replies

AJAX :: ModalPopUpExtender Inside ModalPopUpExtender

Sep 3, 2010

I have a modal popup extender with one control (ascx) this control has a label that on onclic method call other popup extender.

It's has other ascx, it's has a button for a search. When I do Click in this button in first time, the event click not fired and there are a javascript error that say "this._activeDRagVisual is null reference".

In the other hand, If a use de second popup inside an asp page the event and control work correctly. The problem is with the popup inside popup.

View 3 Replies

Executing Another .vb Code File From Code Behind?

Jan 20, 2010

I just finished building a new version of a web app that imports custom-formatted documents. However, now I just found out that I need this web app to also import custom documents from 3 years ago. I have the code from 3 years ago that imports the older docs...

I was wondering if I could put some type of "if then" statement in my code like " If oldVersionofDoc Then...execute the old code located in this .vb file".

View 5 Replies

Confirmation Before Executing CS Code?

Mar 20, 2010

I want to execute a CS Code but before that, i want a confirmation from user, it will be a javascript confirmation box, if the user say yes, then execute the code, or else leave cs code don't execute

below is my button code

<asp:Button runat="server" ID="EmptyButton" OnClick="EmptyButton_Click" OnClientClick="EmptyMyCart()" />

View 5 Replies

RegisterClientScriptBlock Code Not Executing?

Apr 12, 2010

I'm using the following code in an attempt to show a dialog with a list of errors on the client:

if (rollout.ImportErrors.Count > 0)
{
ClientScript.RegisterClientScriptBlock(GetType(), "showErrors", "showErrors();", true);
}

The error count is non-zero and the following script block is emitted, but the script isn't executing.

<script type="text/javascript">
//<![CDATA[
$("#error-report").dialog("open")//]]>
</script>

If I call the function directly from a Firebug console window, the dialog shows properly, so I know the dialog and my code are working. BTW, this code is in a content page, using a content placeholder that 'injects' code into the element of the rendered page.

View 3 Replies







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