Panel Populated By Xslt Transform - Can't Access Controls Values In Postback

Sep 22, 2014

I have a page with an panel on it that can contain a number of editable controls (textboxes, date pickers etc). This panel (and the controls) are populated dynamicaly by loading up an XSLT tranformation and applying it to an XML document (which represents the entity being edited) in the Pages Load event if !isPostBack.

Once the user has made changes they click a button and the form posts back. At that point I want to be able to go through the various controls in the panel, get the updated values and persist them back to a database. When I try to access the controls in the underlying buttons even theyre not there the panel is empty.

What I think is happening is that the page is being recreated at the start of the post back. When its recreated the XSLT transformation doesnt run because its a postback so the edit panel never gets repopulated. The controls therefore dont exist as far as my Button handler is concerned and it cant access their values.

My stopgap solution to this is that Im not checking isPostBack before repopulating the panel, so now the panel gets repopulated in the post back, the controls are there and Im able to query their values. The problem is that this involves another round trip to the database server to pick up the xslt and thats undesirable.So, first of all, have I understood the problem correctly?

I could save the trip to the db by storing the xslt (probably in the view state) but the whole idea of having to load up the control before checking its values feels sort of wrong and Im concerned that Im doing the wrong thing without realising. When I repopulate the control I am, of course, applying the XSLT to the XML document as it stood before the user made any edits. I would have expected querying the value of a control to return me the value before the user changes, but it actually seems to return me the value of the control as it was in the page when the user clicked the button. How can that be?

View 6 Replies


Similar Messages:

.net - Xslt To Transform Format Of Xml Document

Nov 19, 2010

i have the xml in a structure such as this:

<RWFCriteria reportType="ProgramReview">
<item id="36" name="" value="9" type="Milestone" />
<item id="31" name="" value="9" type="Milestone" />
<item id="33" name="" value="11" type="Milestone" />
</RWFCriteria>

View 1 Replies

Web Forms :: CheckBoxList Dynamically Populated How To Retrieve Values During Postback

Apr 30, 2010

I have a form with 2 sections. The first one contains some radio buttons. The second one contains a checkboxlist. When we change the selected radio button then it modifies the elements in the checkboxlist. For this I setted the radio buttons with autopostback, and in the code behind (in OnLoad) I populate the CheckBoxList depending on the selected radio button.

This work fine.

The problem is that I also have a button at the end of my form which post the data of my form in another page (with PostBackUrl). Then in that page I would like to retrieve the values of the checked checkbox. But I can't find how to do that. In the Request.Form I don't see anything.

I searched on the web but I didn't found really a solution.

View 3 Replies

Controls Generated From XSLT Don't Show Up In Panel Added As A Literal Control

Feb 17, 2010

I have the following code:

XElement Categories =
new XElement("Promotions",
from b in db.GetPromotions()
select new XElement("Promotion",
new XElement ("Category",b.CategoryName),
new XElement("Client",b.ClientName),
new XElement("ID",b.ID),
new XElement("Title",b.Title)));
XDocument mydoc = new XDocument();
mydoc.Add(Categories);
try
{
// Load the style sheet.
XslTransform xslt = new XslTransform();
xslt.Load(@"C:WebDesktopModulesPromotionsTransList.xslt");
// Execute the transform and output the results to a writer.
StringWriter sw = new StringWriter();
//XsltSettings mysettings = new XsltSettings();
XmlWriterSettings mysettings = new XmlWriterSettings();
xslt.Transform(mydoc.CreateReader(),null, sw);
String mstring = sw.ToString();
It generates the following string:
<ul id="red" class="treeview-red" xmlns:asp="http://schemas.microsoft.com/ASPNET/20">
<li><span>Arts & Entertainment</span><ul>
<li><span>Client 1</span><ul>
<li><span><asp:LinkButton ID="LinkButton2" runat="server" OnClick="LinkClicked" Text="Get your Free 2" /></span></li>
<li><span><asp:LinkButton ID="LinkButton4" runat="server" OnClick="LinkClicked" Text="Get your Free 4" /></span></li>
<li><span><asp:LinkButton ID="LinkButton5" runat="server" OnClick="LinkClicked" Text="Get your Free 5" /></span></li>
</ul>
</li>
</ul>
</li>
<li><span>Community & Neighborhood</span><ul>
<li><span>Client 2</span><ul>
<li><span><asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkClicked" Text="Get your Free 1" /></span></li>
</ul>
</li>
</ul>
</li>
<li><span>Education</span><ul>
<li><span>Client 3</span><ul>
<li><span><asp:LinkButton ID="LinkButton3" runat="server" OnClick="LinkClicked" Text="Get Your Free 3" /></span></li>
</ul>
</li>
</ul>
</li>
<li><span>Home & Garden</span><ul>
<li><span>Client 4</span><ul>
<li><span><asp:LinkButton ID="LinkButton6" runat="server" OnClick="LinkClicked" Text="Get your Free 6" /></span></li>
</ul>
</li>
</ul>
</li>
</ul>

Now I take the string and add it to a panel which is part of a view in a multiview control: Panel1.Controls.Add(new LiteralControl(mstring)); I have tried to play with Page.ParseControl, but I cannot get it to work right in the panel, the linkbuttons do not show, even though the text is there in the source. Now I tried this: Control myctrl = Page.ParseControl(mstring); Panel1.Controls.Add(myctrl); and I get this as the one of the controls:

a id="dnn_ctr954_ViewPromotions_LinkButton2" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("dnn$ctr954$ViewPromotions$LinkButton2", "", true, "", "", false, true))">Get your Free 2</a>

It doesn't work the way expected, dotnetnuke is doing some nutty stuff here using the parse control. it seems to drop my LinkClicked event.

View 3 Replies

C# - Access Values Of Controls Dynamically Created On Postback?

Jun 11, 2010

My problem is:

I've got a table, dynamically created, fill with a lot of dropdownlists witches IDs are dynamically created.

When a button is pressed, I need to scan all controls in the table and save their value.

But after the postback I can't no longer access to the table.

View 2 Replies

AJAX :: How To Postback The Values From ModalPoup Panel To Gridview Row

Dec 17, 2010

I'm new with ajax control. I have a Gridview in which there're two columns: a text box and a hyperlink. When hyperlink is clicked, a modalpopup will show up. Inside the modalpopup panel, there're a checkboxlist, ok button and cancel button. When Ok button is clicked, I'd like to post back the list of items that's checked to the corresponding gridview row. I'm trying to do the postback on the code behind with c#. My problem is I don't have a row index for me to know which row to postback.

Here is my code:

[code]....

View 4 Replies

Forms Data Controls :: Old Values Populated As Null From ListView?

Mar 28, 2010

m using a listview and an object data source in my application, with optimistic concurrency control.i have only 2 columns in the listview: category_ID and category_name;when i try to delete an item, an error message is generated saying that one of the old values populated by the list view is null, i performed debugging, and found that the category_ID old value is populated correctly, while the category_name old value is populated as nulli can't find a problem in the code, i executed the delete command in the query builder directly and it worked fine,

View 2 Replies

C# - Getting Variable Values Out Of XSLT File?

Feb 17, 2010

I wanted to find out if there is a way of getting a parameter or variable value out of an XSL file. For example, if I have the following:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="username" select ="usertest"/>
<xsl:variable name="password" select ="pass"/>
<!-- ... -->
</xsl:stylesheet>

I would like to read the username and password values from the XSL and use them for authentication. I am using ASP.Net and C# to perform the actual transform on an XML file.

share code with me that would allow me to read the XSL variables from ASP.NET/C#.

View 3 Replies

Data Controls :: Multiple DropDownList In GridView Populated With Unique Values?

Mar 26, 2016

Multiple DropDownList in GridView populated with unique values in ASP.Net

View 1 Replies

Web Forms :: Create Dynamic Radio Buttons In Webpage And Then Access Their Values In Postback?

Mar 24, 2011

I need to create dynamic radio buttons in my page, and then access their values in postback

I create the buttons using the following code:

[Code]....

In the post back I try to access the radio buttons using their created ID:

[Code]....

But it seems that the find method is never finding the Radio button control.

View 1 Replies

Forms Data Controls :: Passing Populated Search Values In A Gridview To Another Page Using Querystring Or Sessions

Nov 8, 2010

We do have a search page for customers which returns a list of data from a table.

Once we select on an item it should redirect to another page with customerId as a querystring parameter..

Now the problem is we have to save all the customerIds and need to send them to display page..and need to select next one once they done with previous one without going to the search page again..

Example:

if they got 10 customers in the search page then we need to send all 10 ids to display page by starting display of firstone and once they select next button on display page they have to move on to the next cutomer from that list..if they reached the end of list they have to start again from the first...we need to avoid the user going to the search page for each customer every time...

View 4 Replies

Finding A Way To "transform" Specific Sections Of Values Instead Of Replacing The Whole Value?

May 26, 2010

Does anyone know if there is a way to "transform" specific sections of values instead of replacing the whole value or an attribute?

For example, I've got several appSettings entries that specify the Urls for different webservices. These entries are slightly different in the dev environment than the production environment. Some are less trivial than others

[code]....

I've looked through the available web.config Transforms but nothings seems to be geared towars what I am trying to accomplish.

View 2 Replies

JQuery :: How To Use Jquery In Xslt That Fill A Combo Box ,also Require Xml ,xslt ,xpath Editior

Dec 29, 2010

[Code]....


View 2 Replies

ADO.NET :: Passing A Complex Model To A Create View So It Can Be Populated On The HTTP-Postback?

Oct 25, 2010

I have a somewhat complex model that I need to pass to a MVC 2 Create view so its properties can be filled out. I'm not sure how to actually create this model as it has some relationship data that must also be filled out during the creation process.My main model is a Game. Most of its properties are scalar. It contains a foreign key to Content, for the game reviews, and there's a many-to-many relationship between Games and Platforms - games can be on a variety of platforms (PS3, XBox 360, etc.), and each platform has a library of games.When I pass data to my Edit view, it's as simple as:

[Code]....

I'm unsure what to do in the case of Create as I'm not sure how to link the associated parts - Content and Platforms - to a Game object.

View 1 Replies

How To Prevent Master Page Postback When Update Panel Asynchronous Postback Happened

Oct 15, 2010

When an asynchronous postback happened inside update panel, another postback happens also for MasterPage not only update panel embedded page .

I want to prevent this MasterPage postback .

is this possible ? think like i have a MasterPage

and another page which is test.aspx which is content page of MasterPage

i have update panel at test.aspx

when asynchronous postback happens at this test.aspx update panel it also loads MasterPage Page_Load

i want to prevent this (it should not also load MasterPage Page_Load)

View 2 Replies

AJAX :: How To Prevent Master Page Postback When Update Panel Asynchronous Postback Happened

Oct 15, 2010

When an asynchronous postback happened inside update panel, another postback happens also for MasterPagenot only update panel embedded page .I want to prevent this MasterPage postback . is this possible ?think like i have a MasterPage and another page which is test.aspx which is content page of MasterPagei have update panel at test.aspxwhen asynchronous postback happens at this test.aspx update panel it also loads
MasterPage Page_Loadi want to prevent this (it should not also load MasterPage Page_Load)

View 3 Replies

Switch From Async PostBack To Full PostBack In An Update Panel?

Aug 20, 2010

Is something like this possible?

Dim iCounter as Integer
Dim iQuantity as Integer = 10
Protected Sub btnFoo_Click Handles btnFoo Yadda
For i as Integer = iCounter to iQuantity - 1
//do something with AsyncPostBackTrigger until iCounter = iQuantity - 1
//then trigger a full postback
Next
End Sub

I am new to the concept and feel like there must be something really easy that I am missing.

View 2 Replies

Web Forms :: Remove Duplicate Values From DropDownLists Populated From Database

Mar 18, 2013

Table1:


ID         FROM          TO

12        TXS             NY

12        LS               NY

This is my table ... I am retriving the values of "FROM"  and "TO"  based on the id .. Separate Dropdownlist for FROM & TO . While Displaying , in  "TO" Dropdownlist NY value is repeated twice .. How to remove the duplicate value? need vb coding frnz ...

View 1 Replies

Access :: Bind Populated Label To Database Field?

May 10, 2010

I'm using the below code to populate a label inside my insert template with the logged in users' name...

<asp:Label runat="server" Text="<%# Membership.GetUser().UserName %>" id="Label1">
</asp:Label>

Now that my label gets the UserName how can I also bind this label to the field "name" in my database when the user submits?

[Code]....

View 2 Replies

Web Forms :: Retrieving Item Values From A Dynamically Populated CheckListBox During Page_Init

Jan 15, 2010

i have a checklistbox that is databound during Page_Init in an

If (!Page.IsPostBack)

block. the user can then check off certain values, and click an asp.net button which posts back the form and renders a crystal report on the same page.

i need to be able to determine which items were checked in the control so that they can be used as parameters in the crystal report. rendering must be done during Page_Init.

the checklistbox object is on the page during design time; only the items are dynamic.

i tried using the Request.Form object during Page_Init to obtain the checkboxlist's items but either i didn't code it correctly or it can't be done that way...

can the checkboxlist items' values be obtained during Page_Init, and if so, how?

View 4 Replies

Upadate Panel's Child Controls Are Not Causing Partial Postback?

Mar 18, 2010

I have put several buttons and panels in my update panel. I also have a script manager on that page. now when I click on any of the buttons then the functionality is working fine but problem is that the complete page gets reloaded witha a flick, instead of updating the update panel only. I have set the "children as trigger" property of update panel "true".

View 1 Replies

Data Controls :: Bind GridView Without Doing PostBack And Without Using AJAX Update Panel

Jul 14, 2013

Gridview binding data from database without doing postback on the select of item in dropdown.i know it is possible through ajax update panel but for some specific reason it can't use it.And i think that gridview is a server-side control and if i implement it by using table structure , jquery ajax and web service  then it will loose all gridview properties of edit, update and paging etc.

View 1 Replies

Data Controls :: Keep Nested Child GridView Expanded In Update Panel On PostBack?

May 7, 2015

I am using nested gridview from [URL].  

I follow this link [URL] .... to solve my problem. 

Your code is useful and perfect for me.but my gridview and button are inside update panel.

So Nested Child GridViews is not remain Expanded on postback. Where should I need to do change to remain child gridview epanded on postback.

View 1 Replies

DataSource Controls :: Transform LINQ Dataset Into A Matrix For Export

Jun 1, 2010

I've got a data table with columns in which include Item, Category and Value (and others, but those are the only relevant ones for this problem) that I access via LINQ in a C# ASP.Net MVC app. I want to transform these into a matrix and output that as a CSV file to pull into Excel as matrix with the items down the side, the categories across the top and the values in the row cells. However, I don't know how many, or what, categories there will be in this table, nor will there always be a record for each item/category combination.

I've written this by looping round, getting my "master category" list, then looking again for each item, filling in either blank or Value, depending on whether the item/category record exists, but as there are currently 27000 records in the table, this isn't as fast as I'd like. Is there a slicker and faster way I can do this, maybe via LINQ (firing into a quicker SQL statement so the DB server can do the leg-work), or will any method essentially come back to what I am doing?

View 2 Replies

Forms Data Controls :: Transform Datatable To A Gridview With A Hyperlink Column?

Feb 10, 2011

I want to transfer data from datatable to a gridview with a hyperlink column. But dont know how to do.

I attach my code as below, what i want to do is to output 2 columns in gridview, and the first column should be a hyperlink. However, now the first column still shows nothing.

Web page code:

[Code]....

C# code:

[Code]....

View 6 Replies







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