|
Can you illustrate this with a line of code?
I know how it's done in theory, but not the syntax. Can I go directly on the DataSource?
|
|
|
|
|
Try using the DropDown.SelectedValues method to get the values of the selected items then just assign those values to the textbox in which you wish to diplay them.
eg. textbox1.text = DropDown.SelectedValue.ToString();
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
Thanks, but it's not the selected value I'm after.
Say that my query looks like this:
SELECT PERSON_ID,PERSON_NAME,PERSON_ADDRESS
FROM PERSON
ddlPerson is bound with this query. Value is PERSON_ID and PERSON_NAME is the displayfield.
When I select a person in the dropdown I would like to display PERSON_ADRESS in a TextBox.
|
|
|
|
|
You then use that selected person's id to access the database and retrieve the value as such:
int id = ddlPerson.SelectedValue.ToString()
UserInfo ui = con.GetUserByID(id);
tbPerson_Address.Text = ui.Person_Address;
Make sure that the people databound to the list are databound by their id value and this code should work just right.
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
Sorry, don't convert to String.
"Sex is not the answer, it's the question and the answer is yes"
|
|
|
|
|
Thanks, but I was wondering if I could get the value directly from ddlPerson's DataSource somehow.
|
|
|
|
|
I am a beginner in asp.net. I am using sql database as a backend and asp.net with c# as frontend. Can anybody tell me how to save records in sql database through code.
|
|
|
|
|
This is an example of a situation where you are sufficiently a beginner that you should not be writing any sort of commercial code, and the code you're writing to learn, should be based on a book you're working through. You asked a very top level question, one trivially answered with a google search, or best answered with a book. I can't imagine how I'd give a detailed answer to such a broad question in the context of a forum post. Perhaps you should do some research and ask here when you have sufficient experience to ask specific questions, and to understand the answers ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
http://www.asp.net/LEARN/videos
a nice easy video for you to watch
We are not a Code Charity
|
|
|
|
|
How to reduse this Reload a new page into the browser to fire the unload event for this page. and I can also use the back or forward buttons to load a new page and fire this event.?????
|
|
|
|
|
You can't. IE doesn't give you that sort of control.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi iam binding my gridview in runtime Using dartabase...,
So its in autogenerate columns true mode...,
How i can tell my particular cell value want to be left align?,
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
You can't, you need to create a template for that, and you're skipping that step with the autogenerate. You may be able to do some sort of change in the item data bound event, but it seems like a hack compared to just creating your template in the first place
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I am trying to do ajax with jquery and I am finally making some progress.
I been following this tutorial
http://www.codeproject.com/KB/ajax/AjaxJQuerySample.aspx[^]
and it basically seems that in order to get jquery ajax to work you need to make a separate file for the code you want to get back.
Now in the article it states this: "(**Note: You could also point to an HttpHandler, but in the interest of brevity, this example will follow this method.)"
So am I correct basically if I followed the tutorial I would have to make a separate file for each of my ajax functions? So if I got 6 buttons that do 6 different ajax requests I would need 6 .aspx pages? Or 6 of these HttpHandlers?
If some where are some tutorials on HttpHandlers used with jquery?
|
|
|
|
|
I don't think so, I think you can pass something on the URL to tell your HTTP handler which action to perform. If you just create a new HTTP handler using the VS IDE, you can point to that, and write code in there to return whatever you like.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I am new comer to .Net.
I am developing a simple application in C# and Asp.In that application I have to write the code to download a software from particular site and the code to install that software in our system.I don't have any knowledge on how to create set up file,code to download, .Exe file etc.
Please anyone Help me.I will be very thankful to them.
Thanks in Advance
|
|
|
|
|
you can't install a program from ASP.NET. You download a file by providing a link to it, or if you prefer, using Response.BinaryWrite to pass it back from a page.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Please search the Internet before posting questions like the above.
If you are a newcomer to aspnet the search for tutorials
We are not a Code Charity
|
|
|
|
|
Dear all ,
I am using C# ,asp.net2.0
I am making question list (as question are dynamic) I list in gridview and inside gridview dropdownlist populated with possible response.
Now I have to fetch each row of gridview and user response against it on button click outside of gridview
Please suggest some link or ideas
Thank you
regards
imran khan
|
|
|
|
|
Try it..Wait for good Solution...
Under button Click
for(int i=0;i<=gridview.rows.count-1;i++)
{
string answer=gridview.rows[i].cells[index].text;
}
|
|
|
|
|
I am using a dll, itextShart.dll
To export data to PDF files
It works fine in my local system but on uploading this to the
Server I am getting an error
As bellow
Could not load file or assembly 'itextsharp, Version=4.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The module was expected to contain an assembly manifest. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.BadImageFormatException: Could not load file or assembly 'itextsharp, Version=4.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The module was expected to contain an assembly manifest.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'itextsharp, Version=4.0.6.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' could not be loaded.
WRN: Assembly binding logging is turned OFF.To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.Note: There is some performance penalty associated with assembly bind failure logging.To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
What can I do
To work things fine
Kodee
|
|
|
|
|
Looks like you didn't copy the manifest file to the server.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for answering Christi.
Can u tell me what is the manifest file and where can i find that file.
I have downloaded the itextsharp.dll file and im uploading the same to the server.
Kodee
|
|
|
|
|
i wrote this code does any body know why is it wrong ? how should i write yhis:currentUser.IndexOf("\")
string currentUser = WindowsIdentity.GetCurrent().Name;
currentUser = currentUser.Substring(currentUser.IndexOf("\") + 1);
|
|
|
|
|
Well, why do you tink it's wrong ? You don't tell is if there's an error, if there's a wrong result, or what.
First problem: \ is used to escape things. So , \" puts a quote in the string, it does not equate to a \ in quotes. "\\" or @"\" is what you need
Second problem: this code assumes that there's a character after the slash in currentUser. If not, it will blow up.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|