AJAX :: Save / Retrieve The X And Y Positions Of A Dynamically Created ModalPopupExtender Window?

Nov 22, 2010

I am using the code below to recreate a modalPopup window. At each UpdatePanel refresh I "lose" the window but I recreate it again after my Panel is updated. This gives me the impression that the windows is always open. The only problem is after I drag and drop it to a different location, the window is recreated back in its original location:

if ($find(MPIDList[clientID]) == null) {
$create(Sys.Extended.UI.ModalPopupBehavior,
{ "BackgroundCssClass": "modalBackground",
"CancelControlID": CancelControlIDList[instanceId],
"DropShadow": true,
"X": 50, "Y": 250,
"PopupControlID": PopupControlIDList[instanceId],
"PopupDragHandleControlID": PopupDragHandleControlIDList[instanceId],
"id": MPIDList[instanceId]
}, null, null, sender);

So I was trying to do the following:

1 - Initialize a global var for X and Y with the static values of 50 and 250;

2 - Show the window and drag it to a different location;

3 - UpdatePanel is refreshed and my Gridview is data bound with new data

On step 3 above I need to find a way to save the current window position BEFORE UpdatePanel is called and apply the saved position AFTER the UpdatePanel call is finished.

View 1 Replies


Similar Messages:

Web Forms :: Retrieve Dynamically Created Controls?

Sep 13, 2010

I am building a webform dynamically but when I go to get the values the placeholder has no controls. Every control added has an unique ID. Does anyone know what I am doing wrong (language is C#).

aspx page

<asp:UpdatePanel ID="upShoppingCart" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<asp:PlaceHolder ID="phShoppingCart" runat="server" />
<br /><asp:Button ID="btnUpdateCart" runat="server" Text="Update" OnClick="btnUpdateCart_OnClick" />

[Code]....

View 6 Replies

C# - How To Open The Download Window When A Dynamically Created Link Is Clicked

Apr 27, 2010

i have stored the txtfile in the database.i need to show the txtfile when i clik the link. and this link has to be created dynamically.

my code below:

aspx code:

[code]....

i have got the link dynamically, but i did not able to download the txtfile when i clik the link. how to carry out this.

View 2 Replies

How To Save The Dynamically Created Textbox Value In Database

Oct 15, 2010

how can store the text value of dynamically created textbox in database.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class frndslambook : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
SqlCommand com1;
SqlCommand com;
SqlDataReader dr1;
static string[] exp;
static string exp1;
static long c;
TextBox[] textBoxArr = new TextBox[c + 1];
protected void Page_Load(object sender, EventArgs e)
{
com1 = new SqlCommand("Select * From slambook Where username=@username", con);
com1.Parameters.Add("@username", SqlDbType.NVarChar).Value = Session["userfrndname"].ToString();
try
{
if (con.State == ConnectionState.Closed)
con.Open();
dr1 = com1.ExecuteReader();
if (dr1.Read())
{
string exp1 = dr1["slambookfields"].ToString();
long c = Convert.ToInt64(exp1.Length);
Label[] l1 = new Label[c + 1];//array of lables
TextBox[] textBoxArr = new TextBox[c + 1];//array of textboxes
exp = (exp1).Trim('^').Split('^');
for (int i = 0; i < exp.Length; i++)
{
Panel frndstextBoxLabelGroup = new Panel();
l1[i] = new Label();
l1[i].ID = "frndslambooklabel" + i.ToString();
l1[i].Text = exp[i].ToString();
l1[i].Visible = true;
textBoxArr[i] = new TextBox();
textBoxArr[i].ID = "frndslambooktextbox" + i.ToString();
textBoxArr[i].Visible = true;
//Initializing the TextBox so that it is not rendered in the browser
frndstextBoxLabelGroup.ID = "frndstextBoxLabelGroup" + i.ToString();
fspfrndslambook.Visible = true;
// Pnl_TextBox.Controls.Add(br);
frndstextBoxLabelGroup.Controls.Add(l1[i]);
frndstextBoxLabelGroup.Controls.Add(textBoxArr[i]);
fspfrndslambook.Controls.Add(frndstextBoxLabelGroup);
}
}
}
catch (Exception exc)
{
}
finally
{
con.Close();
}
}
protected void fsbfill_Click(object sender, EventArgs e)
{
com = new SqlCommand("Insert Into slambookans (slambookfields_ans,sender,receiver) Values(@slambookfields_ans,@sender,@receiver)", con);
for (int i = 0; i < exp.Length; i++)
//{
//textBoxArr[i] = new TextBox();
com.Parameters.Add("@slambookfields_ans", SqlDbType.NVarChar).Value =textBoxArr[i].Text;
}
com.Parameters.Add("@sender", SqlDbType.NVarChar).Value = Session["username"].ToString();
com.Parameters.Add("@receiver", SqlDbType.NVarChar).Value = Session["userfrndname"].ToString();
try
{
if (con.State == ConnectionState.Closed)
con.Open();
int i=com.ExecuteNonQuery();
if(i!=0)
Response.Write("Success");
else
Response.Write("Fail");
}
catch(Exception exc)
{
}
finally
{
con.Close();
}
}
}

View 12 Replies

Save A Dynamically Created .CSV File To The Server?

Mar 7, 2010

I was wondering does anyone know how to save a file to the sever without using a fileupload? What I have is a file that is dynamically created as a .CSV file. Here's that part of the code:

[Code]....

How can I save that to the server instead of poping up a Save/Open dialog box?

View 5 Replies

Web Forms :: Save Selection Of Dynamically Created CheckBoxList?

Mar 11, 2010

I was wondering how about may I save the selection of the checked items of a dynamically created CheckBoxList?On postback the entire checkboxlist is lost. As the CheckboxList items are manually added in and not databinded, the selection is also lost.I was thinking of javascript, but i'm not sure how to implement it.

View 3 Replies

Web Forms :: How To Save Dynamically Created Buttons In Database

Apr 16, 2013

I created a web site with admin control with C# ASP.Net. Admin can create a new button1 with button2.I did this. but when admin login again the created button is not seen.I guess I should save this created button at SQL Server but how should I do.

My code which create dinamically button is here:

Button btn2 = new Button(); btn2.ID = "btnEdit"; btn2.Text = txtKategoriEkle.Text; btn2.Attributes.Add("OnClick", "btnEdit_Click"); btn2.Attributes.Add("onclick", "my_javascript_function"); form1.Controls.Add(btn2);

View 1 Replies

AJAX :: CollapsiblePanelExtender With A ModalPopupExtender Window?

Jan 3, 2011

I have a page which consists of a CollapsiblePanelExtender. To be specific, I have placed all my controls inside a panel and specified the TargetcontrolID as this panel and this is working perfect..Now, I just included a ModalPopupExtender control in the same page and specified the PopUpControlID as this same panel. Query1: Can CollapsiblePanelExtender and ModalPopupExtender work together?

I have also specified the CSS for the panel and for ModalPopupExtender. Have attached a part of the aspx page below.

[Code]....

View 1 Replies

Data Controls :: Save Text Of Dynamically Created TextBox

May 7, 2015

i can add the dynamic textbox in dynamically created html but can not get the value of dynamically added textbox.

there is code what i do

protected void txtNoOfTypes_TextChanged(object sender, EventArgs e)
{
int n = Convert.ToInt32(txtNoOfTypes.Text)+1;
for (int i = 0; i < n; i++)
{
Label MyLabel = new Label();
MyLabel.Text = "Type" + " " + ViewState["num"] + i + " " + ":" + " ";

[CODE]...

View 1 Replies

AJAX :: Modalpopupextender Not Displaying The Popup Window

Feb 3, 2011

[Code]....

Modalpopupextender not displaying the popup window

View 7 Replies

AJAX :: Save Button In ModalPopupExtender?

Dec 22, 2010

I would like to put a button that saves data to a database inside a ModalPopupExtender.

I would like that when this button is clicked that it should NOT close the ModalPopupExtender.

View 4 Replies

AJAX :: AjaxToolkit:ModalPopupExtender To Show A Modal Window Panel

Feb 25, 2010

I use ajaxToolkit:ModalPopupExtender to show a modal window panel. The panel among other things contains a "Submit" button. I would like to call a code behind function on Submit. First I tried this:

[Code]....

But btnSubmitOnHold_Click() is never called. Then I replaced OnClick="btnSubmitOnHold_Click" with OnClientClick="SubmitPutOnHold" and added

<script type="text/javascript">
function SubmitPutOnHold()
{
alert('blah');
}
</script>

This alert also never shows up. Finally, I tried

<ajaxToolkit:ModalPopupExtender ID="OnHoldModalPopupExtender" runat="server" TargetControlID="btnPutOnHold" PopupControlID="pnlOnHold" BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="btnSubmitOnHold" CancelControlID="btnCancelOnHold"
OnOkScript="SubmitPutOnHold" >
</ajaxToolkit:ModalPopupExtender>

View 2 Replies

AJAX :: Modalpopupextender Can't Disable The Parent Page When Popup Window Is Open

Dec 23, 2010

[Code]....

modalpopupextender can't disable the parent page when popup window is open

View 5 Replies

AJAX :: ModalPopupExtender Goes To Bottom Of Page After Save Or Cancel?

Feb 4, 2010

I have a wierd issue with a ModalPopupExtender. I am using a GridView and a DetailsView Control inside a ModalPopupExtender to show the details. After I Hide the ModalPopupExtender it renders at the bottom of the page. The popup works fine, just when i close it it moves to the bottom. If i click on another item and close it, it just builds at the bottom of the page. If i click Save it closes and falls to the bottom of the page and my Update sql statement contains all the values of the below popups. Wierd huh!

I have tried both using the OKControlID and creating an event handler to do a ModalPopupExtender.Hide(); neither works. I have used the ModalPopupExtender a number of times and have never seen this happen.

View 4 Replies

AJAX :: Add ModalPopupExtender In Gridview Dynamically

Feb 18, 2011

I am using a griview, in gridview placing a linkbutton then when click that linkbutton a modalpopup should occur. I am using oncommandmethod in linkbutton to get sum values, that values is display in the modal popup control.

View 2 Replies

Data Controls :: Save Dynamically Created Gridview Row Data In Database

Dec 26, 2013

i have followed this article and created dynamic rows in gridview on button click: URL....Now i want to save the dynamically created rows data in database/

View 1 Replies

AJAX :: ModalPopupExtender In UserControl.ascx Dynamically Loading Into Placeholder

Jul 28, 2010

if Panel have any aspnet control,panel not popups.otherwise working.whats wrong here ? is it impossible ?

[Code]....

View 1 Replies

AJAX :: Dynamically Create And Display ModalPopupExtender Modal Popup

Sep 28, 2012

I hav One dynamically created LinkButton in Table.. I want dispaly Modal popup exrender Link button Click event.. on

What Should i specify In TargetControlId field=?..

i tried

void amendQty_Click(object sender, EventArgs e)

{ //throw new NotImplementedException();
LinkButton amendQty = sender as LinkButton;
amendQty.ID = "lnkamend";
popupwin.TargetControlId="lnkamend";
this.popupwin.show()
}

but itd doesnt work.. and also i tried

void amendQty_Click(object sender, EventArgs e)
{
//throw new NotImplementedException();
LinkButton amendQty = sender as LinkButton;
amendQty.ID = "lnlamend";

[Code].....

View 1 Replies

AJAX :: Dynamically Fill Textboxes And Choose Option In Dropdownlist For Modalpopupextender?

Sep 7, 2010

I have a modalpopup extender that is brought up if the user presses a button. This is fine and the user can enter the data. There are a number of textboxes and dropdownlists. However, I have a gridview which I want to bring up modalpopupextender so the user can edit an entery. How can I set the data to the controls? A dynamicpopulate extender will repopulate the modalpopupextender with all the data. It doesn't make sense for me. Is there anyway I can populate the data with c#? Also can I assign two buttons to call the modalpopupextender?

View 2 Replies

How To Save And Retrieve Cookies Using Ajax Webservice Calls

Jan 26, 2010

I have web app which stores certain things on a page in a cookie when the page posts back in case the user doesn't finish what they're doing and come back later. But now I must do a javascript time-out and actively save the info to the cookie rather than wait for the user to postback. All my cookie code is on server side where I use Response and Request objects to read and write cookies and I want to leverage that. So I would like to just use ajax calls to a webservice. Is there a way for me to access Request and Response objects and read and write cookies to the browser via those objects during a webservice call? Or should I just go with javascript?

EDIT: Sorry i wanted to specify that I would like to use jquery-ajax.

View 2 Replies

AJAX :: Zooming Of Dynamically Created Plot?

Jan 21, 2011

I am creating a plot dynamically and want to embed the zoom feature to it so that small details could come to notice.

Is there any feature through which i can add a magnifying glass too may page or any other solution is desirable.

View 1 Replies

AJAX :: TabContainer Style - How To Set The Different Widths / Positions

Jul 16, 2010

I am using two different TabContainer's on a single aspx page and I'd like to set the different widths, positions etc. using CSS. So far, this is what I have written:

[Code]....

The first TabContainer's CSSClass = Main, however this still affects the other TabContainer present.

View 2 Replies

Web Forms :: Retrieve Value From Popup Window Opened Using Window.open?

Apr 28, 2010

I am trying to open a popup window from main window using window.open() method. How to get back the value from the called popup window to the calling window in vb.net, basically i need to get back the value and populate in the text box available in the main window.

View 3 Replies

AJAX :: Dynamically Created Popup Control Extender

Apr 5, 2010

Im trying to dynamically create a popup control extender for labels which are also dynamically created. the labels are one a dynamically created accordion pane. Here is a section of my Page_Init method:

[Code]....

When I run the site with this code I get the following error:Microsoft JScript runtime error: Sys.ArgumentException: Value must not be null for Controls and Behaviors.Parameter name: element

I thought it might be because the target control ID changes during compilation so i tried to find the labels in the Page_InitComplete method with this:[Code]....

The expression in the FindControl argument is what the id of the label looks like when i view source in my browser after running the page.I also tried to use the popup control's DynamicControlID property, but im not sure what the DynamicServiceMethod is for.

View 3 Replies

AJAX :: Can't Access Dynamically Created Textbox In Postback

Sep 20, 2010

I have a script which creates a dynamic textbox (and more) in an AJAX async post back. But when I try to acess the textbox I am told "Object reference not set to an instance of an object". I have been strugleing with this for a long time. This is written in C# .Net 4. The line causing the problem is the very last one where I have tbGameName.Text.Trim()

[Code]....

View 2 Replies







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