datalist size + value of textbox after postbackurl

Hello everybody, asp.net is pretty new to me so i have a few simple questions. I am working on a page to send emails.

First, i have a table with in one row a datalist, that is a presentation of email attachments. Now I loop through all these elements and i want to show them all after each other horizontal, but the problem is that if i don' t specify the number of columns the size of my page ( and table )  will increase if the list of items becomes to great, and if i specify for example 4 columns, everything looks ok if i have for example 4 attachments, but when i have only 2 attachments, they don' t come after eacht other, but one comes whole to the left, and the other one to its right but with lots of space between them.

Another problem I have is that when i already have my subject and recipients filled in, and I press the button add attachment, what redirects me to another page with postbackurl = ... , when I go back after adding the attachments, the values of the textboxes are lost. I can store these in variables, but i thougth that viewstate already did the trick but I guess I am wrong.

All help and tips are welcome !

 

0
Comerod
4/28/2006 10:07:37 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
511 Views

Similar Articles

[PageSpeed] 10
Get it on Google Play
Get it on Apple App Store

For the first item (the sized datalist), I'd recommend setting the 4 column limit to have the datalist auto-wrap.  You can then avoid fixing the width of the datalist, and instead set the width of each element in the itemtemplate of the datalist (using either a nested <div> or <table>) to a fixed size.  That way the column sizes will stay consistent regardless of how many items there are.

When you navigate to another page, the viewstate of your page will be lost when you redirect back. So if you want to keep these values around it might make the most sense to either store them in a database or in session state.

Hope this helps,

Scott

0
ScottGu
4/28/2006 5:16:29 PM
Reply:

Similar Artilces:

Set TextBox text value to value from DataList Control
I'm sure this is a totally sad question to ask, but... I am using a DataList View to display data. I have a separate form within a LoginView that I would like to use to update a few main fields. I want to set the Text property of the TextBox in my custom edit form to the value of the corresponding field in the DataList. Is this possible? I think i get your question --> you want the text from a  textbox from the datalist to be input into a textbox within your form? try:TextBox tb = DataList1.FindControl("TextBoxIDToFind"); TextBoxOnForm.Text = tb.Text;David Ki...

how ontextchanged event in datalist fire and when that textbox value change than another textbox inside datalist value also change
 i have one datalist into which i used maskededit extender for time entry there is three textbox (1) start_time (2) end_time (3) duration so when enter  end_date value than this text box ontextchage event fire and duration will automatically calculate by(end_time - start_time) and display into datalist duration textbox. in datalist there is more than one item.i put some code so just check  <asp:DataList ID="CONTRACT_SERVICE_ITEM" runat="Server" RepeatColumns="1" RepeatDirection="Horizontal"      &nbs...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

I Used Repeater inside the Datalist now i want to get value of Repeater (textbox control)
I Used Repeater inside the Datalist now i want to get value of Repeater (textbox control) on button click. Button is inside the datalist, Outside repeater.  Depending on datalist "groupId" Repeater is loding and from the repeater i want the value of "Textqty". This is my code <asp:DataList ID="DataList1" runat="server" class="SubContentSearch" DataSourceID="ObjectDataSource1" Width="496px" DataKeyField="id"><ItemTemplate> <asp:Label ID="groupIdLabel" runat="server" Te...

Getting value from a textbox control that was filled with a value from javascript
 I have a textbox control (seen below txtMileageDollars1) that gets filled with javascript based on the number of miles a user types into another textbox (txtMileageMiles1) control.  When I post back with the submit button, the value is blank.  I've tried setting EnableViewState to false, but still cannot get a value on postback.  Does anyone have a solution?   Miles<asp:TextBox ID="txtMileageMiles1" runat="server" Width="50px"></asp:TextBox>   Total (txtMileageMiles1 * rate with javascript)<asp:TextBox...

TextBox control not retaining values inside Wizard Control
I might be doing someting very silly. I have a wizard control. Everthing works fine on Wizardstep 1 . But on the step 2 I have some TextBoxes and a Button. When I click on the button a page postback happens and then there is nothing in the TextBox.Text property in the code behind.   Thanks I notice the status of this thread is “Resolved”, is it marked yourself? If so, please post your answer in order for others member learn from it.  We will greatly appreciate all your sharing.Hong-Gang ChenMicrosoft Online Community SupportPlease remember to mark the replies as answers if the...

problem using datalist / how to get value of a control from datalist
Hi all I have a datalist where i m having one linkbutton(where i display name of product ) when i retrive data in datalist on page load there are many rows in datalist.... what i wnat is i want details of the product in OTHER.ASPX on click of linkbutton which is in datalist  can anyone pls help me out....???     Vimal insstead of using link button and use link that will open a new window with Other.aspx and passing a query string like this <a href="other.aspx?productId=<%Container.DataItem("[ur product id fieldname in db]") %>YasserSpica.www...

Control.Value and Control.SelectedItem.Value
Can someone explain to me the difference between say, Dropdownlist.SelectedItem.Value and Dropdownlist.SelectedValue?? Just curious, Thanks!Tim These are going to return the same thing. dropdownlist.selectedvalue is a shortcut to get the currently selected value in the dropdown. If that is all you want then you can just use that. If you want to access the currently selected item you can use dropdownlist.selecteditem and that return the item and you can then access any of the item's properties, including in this case the value property. If this post answered your question please r...

How to adjust the size of label control in the datalist, according to the size of its text?
Hello guys, I have a datalist with RepeatDirection="Horizontal" and RepeatLayout="table". I have a lable control in the data list. I want the layout of my data looks like data elements 1, data element 2,....... but I can not find a property that could adjust the width of the label control according to the length of the text. So far, my layout looks like data           ,      data element 1          element 2 Could some help   thanks ...

How to add values to template control fields textbox control in GridView..
Hi all,    <asp:GridView ID="GridView1" EnableViewState="true" DataKeyNames="LicenseTemplateID"                       runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged"                       Width="345px">                       <Columns>                           <asp:Templa...

How to change the name value of attributes of textbox control that added DataGrid control?
I created a DataGrid and added a textbox control as a template column and binded a DataSet as for DataSource in my webform1.aspx. when you looked at the HTML format souce code of dataGrid after that have generated . i found all the textbox named with datagrid,textbox and a random number. The question is how can i rename it in running time? i have tried some times in different event of datagrid  but i fail! thanks. Of course the ID of the textbox will not be the same as you named it, because datagrid contains lots of rows and each row will have a textbox, so to...

display the value of textbox server control by clicking the html button control
I have a webform in asp.net where i have a html button control and a textbox server control. When i enter some value in the textbox control and if i click the html input button control i should get the value that is entered in the textbox through an alert message. How to achieve this? Please give me full coding. I am new to asp.net. The code should be vb.net Consider the textbox server control id is TextBox1, below is the code<INPUT style="Z-INDEX: 112; LEFT: 553px; POSITION: absolute; TOP: 50px" type="button" value="Button" onclick="alert(document.getElementById('<%=TextBox1.ClientI...

How to get the Value from the Textbox ?Textbox is created by using add control function.
  Dim textWG As New HtmlInputText textWG.text="Wage Rate" textWG.ID = "txtWG" me.control.add(textWG) i write this code at form load.moreover this form have one save button to save the value from the "txtWG" to database this textbox will be appear when form finish load.but after click save button the value cant be save into database. tat textbox become empty when user click the save button. how can i get the value from that textbox ? Please advice me.Thank you You are using a HTML control and by default, HTML controls dont have a mechanism to pres...

Value of control in DataList
Hi, I'm having a frustrating problem... I have bound a generic listarray as the datasource to a DataList, the DataList contains an editable TextBox (it's databound when loaded). When clicking an update-button, I loop the items in the datalist and want to retrieve the changed value of the TextBox but i can only get in hold of the old one (the bound one...). Anyone has any idea?  Thanks guys! //Anders [SWE]//KyotoKiller [SWE]...

Web resources about - datalist size + value of textbox after postbackurl - asp.net.presentation-controls

Resources last updated: 12/2/2015 7:56:57 PM