|
Hi,
I dont know what control is ir "plhbookfields"
U can use
Dim MyText as TextBox = plhbookfields.FindControl("YourTextboxID")
Now you can access the value by using
MyText.Text
If there are many text box you should make a loop.
"YourTextboxID" is the ID you assigned to text box.
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
ya that only me to finding here,
For Each SubGRD As PlaceHolder In plhbookfields.Controls
Dim t1 As TextBox = CType(SubGRD.FindControl("txttextbox"), TextBox)
next
ya i given like this but i am not getting properly...,
Magi
|
|
|
|
|
Hi,
Here txttextbox is not the id of text box.
txttextbox.ID = "txtproduct" & strfieldnum
You used the above code in your program to generate id.
So use the same mechanism to get id and fin the control.
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
Then whats the id of the textbox??
Magi
|
|
|
|
|
When page is posting I think you can get that on posted values. Means using request.form["TextBoxId"]
|
|
|
|
|
No i didnt get what ur trying to say?,
Plz hlp me...,
Magi
|
|
|
|
|
On page load try writing
Response.Write(Request.Form["YourTextBoxId"]))
If that is not working then try replacing textbox id to name
Last modified: 5mins after originally posted --
|
|
|
|
|
Hi i think u didnt get my probs clearly,
If i know the textbox id probs will be solve...,
See my code in previous msg,in place holder i create textbox at runtime...,
So we want to find first textbox id,
then if more than one textbox will be create in place holder we want to find each and every textbox id...,
Then with that id we can get the values from that textbox...,
So then its not big matter at all to store the database...,
Magi
|
|
|
|
|
Magh_M wrote: If i know the textbox id probs will be solve...,
See my code in previous msg,in place holder i create textbox at runtime...,
So we want to find first textbox id,
I think you know it.
Read your first post. In that you are creating textbox id
|
|
|
|
|
ya i am creating the textbox id...,
But i dont know how to get it..,
Becoz its in placeholder...,
And more than one textbox will be there how u can get each and every textbox id and those values?,
Magi
|
|
|
|
|
Dear all
i am using asp.net2.0, C# and sql2005.
I was trying gridview using templatefield to customize gridview.
My question is how to get selected dropdownlist item value that is used in gridview templatefield..say suppose gridview template populate countries and how to get programtically value of selected country.
thanks
regards
imran khan
|
|
|
|
|
For Each SubGRD As DataGridItem In DDList.Items
Dim Quant As dropdownlistbox = CType(SubGRD.FindControl("txtAddQty"), dropdownlistbox)
next
The DDList is the datagrid id name...,
Now what u have selected that value will be in that Quant variable ,
Magi
|
|
|
|
|
Hello all. Can anyone tell me why this works?
I dynamically create a bunch of Dropdownlists, and every time I do I add them by this.Controls.Add(), but I also add them to a Page.List<dropdownlist> that I made. This is all within Page_Load. I was trying to figure out a way to check the SelectedIndex of each list after Postback.
So after postback, all the dropdownlists stored in my List actually contain accurate SelectedIndex values. How can this be? My List only contains copies of my dropdownlist objects right? And I built the List before their view states should have been updated. Am I missing something?
So basically this works like I wanted, but I don't know why
Thanks!
John
|
|
|
|
|
What is stored in your list is a pointer so it is not a copy but the actual object. So when the object is updated on the post back your pointer is pointed to the updated object.
To store a copy you would have to clone the dropdown and store the pointer to that.
Ben
|
|
|
|
|
Wow really? I'm confused then. What about this:
List<string> dinosaurs = new List<string>();
dinosaurs.Add("Tyrannosaurus")
Err, my point being that the list can't store a pointer to "Tyrannosaurus".
Thanks
John
|
|
|
|
|
There are some items that are stored directly by value. That would be the common types like Strings, int, etc. Any object will always be stored by reference which is a pointer.
Ben
|
|
|
|
|
Hi there,
I'm brand new to ASP.net...currently building my first data-driven site. I've created my database and successfully connected to it. When the data is displayed, however, all my html tags that are in the database record are written out rather than being interpretted as html. For example, I want "<br>" to produce a line break, but it just displays "<br>". Is this by design? I have some ColdFusion experience and CF does not behave in this manner. I expect the same would be true for ASP, but I haven't been able to find any information about it.
I'm connecting to a SQLExpress database on my local machine. I am using a details view to display the information...don't know if that matters. I'm also using a dataset currently, but a direct connection to the database yielded the same results. Here's the code:
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False"
DataKeyNames="Content_ID" DataSourceID="ObjectDataSource1" BorderWidth="0">
<Fields>
<asp:BoundField DataField="Content_ID" HeaderText="Content_ID" InsertVisible="False"
ReadOnly="True" SortExpression="Content_ID" Visible="False" />
<asp:BoundField DataField="Content_Title" HeaderText="Content_Title" ShowHeader="False"
SortExpression="Content_Title" ItemStyle-CssClass="mainhead" ItemStyle-VerticalAlign="Top" />
<asp:BoundField DataField="Content_Text" HeaderText="Content_Text" ShowHeader="False"
SortExpression="Content_Text" />
</Fields>
</asp:DetailsView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="Delete"
InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData"
TypeName="GTGDataSetTableAdapters.ContentTableAdapter" UpdateMethod="Update">
<DeleteParameters>
<asp:Parameter Name="Original_Content_ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="Content_Title" Type="String" />
<asp:Parameter Name="Content_Text" Type="String" />
<asp:Parameter Name="Original_Content_ID" Type="Int32" />
</UpdateParameters>
<SelectParameters>
<asp:Parameter DefaultValue="2" Name="Content_ID" Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp:Parameter Name="Content_Title" Type="String" />
<asp:Parameter Name="Content_Text" Type="String" />
</InsertParameters>
</asp:ObjectDataSource>
Is there anyway of getting this to work the way I want? Thanks in advance for your help. It's much appreciated.
Scott
|
|
|
|
|
I have a web app running on a windows machine. I need it to copy files from a linux box to the box the app resides on. Any idea if this is possible? How would I proceed?
|
|
|
|
|
You could use samba, ftp, or http just off the top of my head.
|
|
|
|
|
I haven't heard of samba , I wasn't sure that http could could do what I wanted , and I didn't even think of ftp ! Thanks for giving my brain a jump start!
|
|
|
|
|
Samba is the Linux implementation of "network neighborhood" so you could access it like \\machinename\folder. With http you just put in a path the web server is using and download it like any other file you on a webpage (http://machinename/file.ext)
|
|
|
|
|
Nifty! That may be the easiest...
|
|
|
|
|
|
I wasn't sure that http could could do what I wanted ! But now that I know it's possible, I'll figure it out eventually! Thanks!
|
|
|
|
|
Hello,
I'm writing a small page that uses Forms Authentication and cookies to help track a login session( My boss doesn't want me to track anything in session states, so a cookie with a token it is...). Currently the whole site is using SSL, but I would like to change it so that only the Forms Authentication and cookie transmission on SSL and have the rest of the site plain text (but restricted with forms authentication). To this end, I have two questions: 1) How do I get cookies to transmit over SSL? and 2) How do I get <asp:login> controls to postback to an SSL page (or however posting it on SSL works).
1) Cookies over SSL
I've read some about cookies over SSL, but I've got some questions about how Cookie.Secure works. I'm starting off this way:
HttpCookie cookie = new HttpCookie("CookieName");
cookie["key"] = result.ToString();
cookie.Secure = true;
Response.Cookies.Add(cookie);
So... after this the secure parameter is set... and I'm hoping that Response.Cookies.Add automatically knows to take care of the little guy with SSL (am I right?). Next, when I request the cookie on another page I
HttpCookie cookie = Request.Cookies["CookieName"];
string temp = cookie.Value;
temp = temp.Remove(0,4);
Guid session = new Guid(temp);
(Now, before you call me on how I'm getting the value from the cookie... Trust me... It's better for what I'm doing to get it this way.)
In short, I hope that Request.Cookies and Response.Cookies transmit over SSL based on the Cookie.Security value with no extra work from me. Is that true, or am I missing something? Also I've read that I can add <httpcookies requiressl="true"> to my web.config file. That sounds easy enough, but again I'm wondering... will Response and Request automatically take care of the change? Also, where in the XML tree does it go? Under Authentication?
2) Partial SSL
I would like an ASP.NET login control to be able to use SSL without requiring the whole site to be SSL. It seems to me that switching between an SSL login page and normal text pages is a bit of a pain with the absolute paths and whatnot. Also, from what I gather cookies don't cross between https:// addresses and http:// address, is my understanding correct? Anyway, it seems to me that it might be easier to get the login control to use SSL instead of the whole page. The problem is, <asp:login> controls don't have any postback attribute to modify. Any thoughts here would be appreciated.
Thanks in advance for reading that long wall of text, and thanks in advance for any advice you may have.
KBTibbs
|
|
|
|