|
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
|
|
|
|
|
Anyone have any suggestions?
|
|
|
|
|
Hi all
I've created a ASP.NET/VB.NET intranet application to maintain a database via a datagrid and was looking to retrieve the Windows username of the current user of the application so that when they click to update any changes they make, a field in the database will update showing that user as the last person to update that record.
I've set the authentication to 'windows' in the webconfig file, could anyone point me to the code I would need to retrieve the windows username?
Many Thanks
Rob
|
|
|
|
|
System.Security.Principal.WindowsIdentity.Name
only two letters away from being an asset
|
|
|
|
|
Hi Rob,
Using this 'Environment.UserName' also you will get windows username.
Kiran Kumar.CH
(MCP)
|
|
|
|
|
|
<br />
function insertAtCursor(myField, myValue)<br />
{ <br />
if (document.selection) {<br />
myField.focus();<br />
sel = document.selection.createRange();<br />
sel.text = myValue;<br />
}<br />
else if (myField.selectionStart || myField.selectionStart == '0') {<br />
var startPos = myField.selectionStart;<br />
var endPos = myField.selectionEnd;<br />
myField.value = myField.value.substring(0, startPos)<br />
+ myValue<br />
+ myField.value.substring(endPos, myField.value.length);<br />
} else {<br />
myField.value += myValue;<br />
} }<br />
------------------------------------------------------------------------------
HTML CODE
here <> = []
[form id="form1" runat="server"]
[div]
[div id="html_div"]
[div]
[FCKeditorV2:FCKeditor ID="FCKeditor2" runat="server" Height="250px" Width="590px" BasePath="/BradCRM/BradEditor/"]
[/FCKeditorV2:FCKeditor]
[/div]
[/div]
[div id="text_div" style="display: none"]
[textarea tabindex='110' name='body' cols="100" rows="20"][/textarea]
[/div]
[/div]
[/form]
------------------------------------------------------------------------------
this is workon IE but this code Does not supported by Mozilla Browser.
please Help Me.
Pavan Pareta
|
|
|
|
|
Hello all,
I'm trying to use the PathsBuildProvider as described in the following article:
http://vaultofthoughts.net/PathsBuildProviderUpdate.aspx
I am the Will Gant mentioned here, and I know I had this working several months ago when I last tried it. However, now it doesn't. I added the App_Code directory and placed an empty pbp file in it, as suggested by the article. My web.config has been altered as follows:
<compilation debug="true">
<buildproviders>
<add extension=".pbp" type="PathsBuildProvider.PathsBuildProvider, PathsBuildProvider.PathsBuildProvider">
Any thoughts?
|
|
|
|
|
<compilation debug="true" >
<buildProviders>
<add extension=".pbp" type="PathsBuildProvider.PathsBuildProvider, PathsBuildProvider.PathsBuildProvider" />
</buildProviders>
</compilation>
|
|
|
|
|
Why and what can I do about it?
I have a calendar control that is contained within an update panel. It all works nice and smoothly and I am happy with it. Demonstrating the app to colleagues and the talk came about as to why I didn’t create a client side calendar control with javascript rather than use the standard asp one. My argument was that the control does what its supposed to and works. He said that if we rolled this out to a customer the amount of data being posted back would mean a slowing down of the app(some of our customers only access is through dial up.) ah ha I said that should not be a problem cos its in an update panel so the whole page is not being posted back only the calendar is!
He then went on to disabuse me of the notion that even thought that is what is supposed to happen asp.net sends back viewstate and rendering info for the whole page!!? From what I have read around the net he appears to be correct as well, its something to do with the page renderer requiring hash codes or something for all the controls on the page. Now this seems poor to me, the only advantage to using this now is cosmetic and I can do without that if its gonna slow my app down.
Has anyone had any experience with this? Am I better to code up a javascript calendar control, and use that or is the pay off between amount of code downloaded for that compared to the data posted back for the Ajax update panel mean that it’s a much of a muchness? I am pretty new to asp and web dev so if anyone can offer a differing method to partially update the page that would also be appreciated…any links to tutorials or lessons or what not, you know the kinda thing The performance hit seems to be the biggest deciding factor in this company as to what tech to use in a certain situation.
Cheers
Ian
|
|
|
|