Custom Server Controls :: CompositeControl Does Not Retrieve FormView Data On PostBack ("Save")

Feb 10, 2010

Background:I'm building a custom control as a base class that derives from CompositeControl. It consists of a FormView, a ObjectDataSource and a CRUD-Button Series (Create, Read, Update, Delete - Buttons). I'm loading the different FormView templates within the deriving classes dynamically from file with Page.LoadTemplate().

Class structure:

TabControlBase:CompositeControl

Employer:TabControlBase

Applicant:TabControlBase

Each deriving class knows the specific template-paths for loading FormViews templates.

The ObjectDataSource is connected with a DAL using a Select and an Update Method. The Select-Method works fine: When loading the CompositeControl the data of the DAL are shown in the Labels of the embedded FormView (ReadOnly-Template). When I'm switching to Edit Mode the data also are displayed in the TextBoxes (Edit-Template).

The problem occurs when I'm trying to update data using the "Save" - Button: The connected DAL-Method is calling properly, but the parameters all are NULL.Tree structure of this custom control:

Panel -
--- FormView
EditTemplate (ascx): Name, Name1, Segment
--- ObjectDataSource
--- CRUD-Button Stack: New, Edit, Delete, Save, Cancel, Copy, Print

All controls will be added dynamically in the base class "TabControlBase" within the overridden CreateChildControls - method. The CreateChildControls method is called by the deriving classes e.g. Employer after setting specific properties e.g. templates,
object data source methods etc.The control is placed in a simple abc.aspx-Page. What I detected so far on PostBack

- When I'm looking at the ViewState Collection within the OnLoad-method of the abc.aspx the ViewState-Collection is Null (Count = 0)

- It seems that the control tree is empty. I'm not able to find any control using a proper working recursive FindControlMethod

- Only the Page.Request Collection shows the expected controls

Conclusion for now:It seems that the CompositeControl "forgets" the values of the FormView TextBoxes on PostBack. It seems it has to do with ViewState Management.

View 2 Replies


Similar Messages:

Data Controls :: How To Save And Retrieve PDF Files From SQL Server Database

Oct 10, 2012

How a pdf file will save in database sqlserver(2008) and Reteriving  all file(s)them in pageload() in required  page? in C#

View 1 Replies

.net - Inheriate From A Custom CompositeControl

Jul 7, 2010

I have created a composite control that has some basically functions. I would like to be able to take that composite control and reuse the code.How do I do this? I have created a class and inheriated from my cc

public class PasswordTextBox : RoundedTextBox

now if I add another property to the new cc everything is over however nothing is rendered on the page.

View 1 Replies

Custom Server Controls :: Custom Radio Button Loses State After Postback?

Mar 24, 2010

I have a custom radiobutton and it renders fine but loses state after postback.

How can it be modified?

[Code]....

View 1 Replies

Custom Server Controls :: Custom Control's Children Do Not Persist Contents After Postback

Feb 25, 2011

I have created a really simple custom control to render panels into a page. The code is below. When I use my control and add any webcontrol to it, after each page postback the contents of these child controls vanishes.

I must have missed something really simple but run the example to reproduce this. Can anyone please enlighten me as to why the controls are being 'emptied' of their contents, and how I stop this occuring?

Here is the code for the control

[Code]....

And here's how I am using it in a sample page:

[Code]....

[Code]....

View 16 Replies

SQL Server :: How To Save And Retrieve Arabic Data In SQL2005

Feb 12, 2011

I have my field type nvarchar(50) and also save my aspx file with unicode with/ (without) signature?But still I am getting the return value ????? and saving also in database by ?????

I am usin SQL 2005 VS.net 2008 and also using some AJAX Controls in my file Like Clander etc.how I can Save and Retrive the Arabic DAta from my Entry Page?

View 5 Replies

Custom Server Controls :: Extend FormView To DeleteItemTemplate?

Dec 28, 2010

all i want to extend FormView with DeleteItemTemplate

<asp:FormView id="sth" runat="server"....>
<DeleteItemTemplate>

<%-- here goes my custom template %-->

</DeleteItemTemplate>
</asp:FormView>

View 1 Replies

Forms Data Controls :: How To Retrieve / Display Image Stored In MS SQL Via FormView

May 4, 2010

I'm amazed that it took me minutes to figure out how to retrieve text from a specific SQL database record and display it on my aspx page using FormView---and yet days later I still can't figure out how to retrieve/display the corresponding database image...(I feel like I went to a fast food restaurant, received my burger and drink in minutes---but for the fries I'm told to leave the restaurant, drive to another county, and search for the granite boulder under which I am to find the next clue in the quest to get my fries.

I don't want to waste anybody's time---I do see that this issue has come up here before (but each solution seems more complicated than the previous one): clearest way (or your favorite past thread on this topic) to retrieve/display/edit binary image data using FormView?

View 3 Replies

Forms Data Controls :: Save All FormView Items At Once?

Oct 29, 2010

I have a page that displays information about a patient's case. The page has some textboxes, labels, etc., and it also has a FormView. The FormView displays details for a particular TEST for this case. The user can page through the different tests, and change some of the data.

There is a button on the page to save all of the case information. I need to save ALL of the tests bound in the FormView.

The two issues are:

I can't save the Test until the user clicks the "Save Case" button (because this is when the case is first inserted into the DB).I would like to avoid have a "save test" button inside of the FormView (because then the user has to page through all tests and save each one manually)How would I do this? I thought about saving the test info in Session somehow.

I have a page with some TextBox controls and also a FormView control that displays details for a particular version of a test. The user can page through the different versions. The user can edit some of the fields in the FormView.

View 3 Replies

Forms Data Controls :: Using Formview To Display And Save Dates In UK Format?

Jul 5, 2010

I am using a SQL DB to save and display a simple collection of data which contains several dates. As the intended audient is UK based, I wish to display the dates in a UK format (DD/MM/YY). This works well (using {0:d}) and the display and creation of records also works fine.

However, as all fields are editable, when the record is displayed in the Formview edit mode and saved, the dates field try and save in the UK format and will more often than not fail with an invalid date error. How can I display the date in a UK format yet get the same field to save in the usual SQL date format?

Gridview/Formview code:

[Code]....

Formview Update page view :

[Code]....

View 4 Replies

Forms Data Controls :: Formview: How To Pick A Filename And Save It To Database

Dec 13, 2010

In my application I have a formview, used for inserting/editing records in a product details table.

My problem is now, that one of the fields is used for the filename of a productimage, uploaded to a folder on the server from another page.

When inserting - or editing - a record, it should be possible somehow to get list of the files in the productimages folder, select one, and then store the filename (no path needed) in the database. basically I need some kind of 'file-picker' to select the filename and put it into a textbox. It could be anything from a dropdownlist to something more sofisticated - as long as I can include it in my formview.

View 6 Replies

Custom Server Controls :: Unable To Trace Value After Postback?

Sep 15, 2010

public abstract class AStateManagement : WebControl, IVFSStateManagement
{
protected PersistScope _StateManagement = PersistScope.ViewState;
protected System.Web.UI.StateBag _ViewState = null;
public virtual PersistScope StateManagement

[Code]....

I have create a custom textbox which will validated the data depending upon the business logic defined at run time. But currently i am not able to catch the update the value inside a textbox (entered by the user). I have implemented LoadPostData but i am unable to get the updated value.

View 1 Replies

Forms Data Controls :: Dropdownlist Pulls From Sql Source Into A Formview To Save To Another Table?

Feb 15, 2011

I have a dropdownlist that pulls from a datasource. When a name is selected all information drops down to a formview. Once there 3 fields get populated from the dropdownlist and then there is 2 other fields that need user input. Once they hit submit, it should write to a different table in the same DB. I cannot get the fields to populate and write to the DB. Here is my code:

[code]...

View 1 Replies

Data Controls :: Save And Retrieve Data Of CheckBoxes Inside Repeater To Database

Feb 3, 2014

When user upload new documents then this document goes for approval to supervisor and for this i use dropdowns ...when I use dropdown the exact result not occur and now i wat to approve/reject through checkboxes...

Here is code:

<table class="CSSTableGenerator" border="0" cellpadding="0" cellspacing="0" id="results">
<asp:Repeater ID="Repeater2" OnItemCommand="Repeater2_ItemCommand"
runat="server" onitemdatabound="Repeater2_ItemDataBound">
<HeaderTemplate>

[Code] ....

Now I want to use checkboxes, how I replace dropdown checkboxes in html and also in asp.net ....

View 1 Replies

Forms Data Controls :: How To Save And Retrieve Multiple Gridview Rows

May 13, 2010

I want to be able to select rows and save them for later display. I wish to store the data in a session object for viewing before i decide to save permanent in database.

View 4 Replies

DataSource Controls :: How To Retrieve The Data From The Session (Dataset) And Save It Into A Database

Mar 24, 2010

How to retrieve the data from the session (Dataset) and save it into a database

[code]...

View 3 Replies

Forms Data Controls :: Save And Retrieve Images To DataList Through MultiUpload?

Aug 14, 2010

i took a Table Name as Gallery Like The Above Pic

Now refer for Below Link & Image..

[URL]

From The Above Link i took the code of JavaScript For MultiUpload...

Now I Want The Code For Button Click When I Click Upload and only images(jpeg/gif/png/bmp..etc) should only be accepted

[Code]....

View 3 Replies

Data Controls :: Save And Retrieve Data From Local And Session Storage

Aug 18, 2015

How save and display data from local storage with angular..I want save this data example

View 1 Replies

Forms Data Controls :: Postback Confirmation Of DB Update From Formview?

Dec 6, 2010

I have Gridview that opens in the Edit Template with UPDATE and CANCEL links at the bottom, so the users can modify records.

When the user clicks UPDATE there is no indication that the DB was updated. I don't want to redirect the user.

What is the easiest way to provide a confirmation that the DB was updated?

View 14 Replies

How To Save Image And PDF File In SQL Server And Retrieve Using C#

Aug 17, 2012

I am having one Event Registration form in that I need to provide one control with which user can attach file it may be pdf file or jpeg(Image). Any sample so that to save pdf file or Image file in DB and how to retrieve it.

View 1 Replies

Custom Server Controls :: Extending A Control And Losing Values On Postback?

Nov 24, 2010

I've created loads of user controls, but this is my first time dealing with extending a server control. The problem I'm getting is that the base control's data is not being persisted across postbacks in a Master/Content page.I'm actually trying to get this working using a Telerik control (for my sins), but the same issue happens with a standard Web TextBox control. Code:

[Code]....

Now, I've copied the way I handle the control state as I do it with user controls (ControlState), and it isn't working. Can someone point me in the right direction please? All the examples I find refer to creating user controls, not extending existing controls. Specifically why nothing is being persisted on post back.

View 7 Replies

Data Controls :: Save And Retrieve Data From ViewState

May 7, 2015

I have the following code:

protected void Page_Load(object sender, EventArgs e) {
if (!Page.IsPostBack) {
ViewState["NewRecord"] = "False";
}

[code]....

I have a button to Save data as well. In this Save routine, I simply look at the value of the ViewState to determine which button the user clicked, because that determines which code I should process. This used to work but is no longer working.

View 1 Replies

Forms Data Controls :: Formview Data Binding On Postback

Jun 15, 2010

In an vwd2005 aspx page, I have a formview, dropdownlist and 2 sqldatasources. My markup is below

[Code]....

When the dropdownlist causes the postback, the formview does not display the data (it's there, I've double checked using query analyzer). Also, the OnIndexChanged only makes a button visible and has nothing to do with the data. What am I missing?

View 7 Replies

Custom Server Controls :: Loading Web User Controls Dynamically On Postback

Mar 2, 2010

First, I would like to apologize, the search on the site wasn't working, so I don't know if I'm missing an existing post or not.

I have a web page that uses a master page file. I am using a third party control from Component One(TabStrip), the tabs are rendered as links on the final page. When a tab(link) is clicked, I need to load the appropriate web user control associated with that tab. Each web user control has its own post backs and methods. I know that I can load the controls on the "SelectionChanged" event of the TabStrip control, but then any postback created by the web user control that is loaded causes the page to refresh and the control was never loaded in viewstate. So, I tried to put my procedure of loading the web user control into the page_init method. This would work, if I could read which link was clicked on from within the page_init method. I tried using a javascript function to run "onclick" of the tabs and within it setting the value of a hidden control. I have verified that the javascript works and that the hidden control's value is getting set correctly. When I get into the page_init method, the value of the hidden control is not readable.

I'm tying to understand the page lifecycle to the fullest, but I don't see what I'm missing here. I know that I need to load the web user controls in the page_init method in order to persist the page as a whole, but how can I get which tab(link) was clicked to know which control should be loaded?

View 5 Replies

Custom Server Controls :: Visible State Of The Div Is Changed In Client Code W/o A Postback?

Mar 11, 2011

In ASP .NET 2.0, I've created a user control which is meant to work as a dropdown or popup by using an <input type="button" id="btnTogglePopup" runat="server" style="display:inline"... /> and <div id="divPopup" runat="server" style="display:none" ... /> the rest of the controls are contained inside this div, and they do mantain their values between posts, etc. This button 'runs at server' but it's not intended to post back or submit.It just toggles the popup (div) visible/hidden using Javascript client code by setting the div's style display property to "none" or "block" The problem I'm having is that when a page containing this control posts back, the state visible/hidden of the div is not maintained. If the user had the popup open, after the postback, it will display closed.I've read a bunch by now about ViewState & ControlState, and have the save and load contol state methods working, but when I step thru them they load old values (setting the popup to hidden all the time),and the popup doesn't work! I've come to think that b/c when the button is clicked,the visible state of the div is changed in client code w/o a postback, maybe I have to maintain this state info in a hidden fiel or something like that?At the same time I don't want to have a hidden field if it's unnecessary,and I may just doing something wrong.

View 2 Replies







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