|
Try this:
1. Default.aspx
<select id="sel1"><option>came here first!</option></select>
<select id="sel2"><option>came here second!</option></select>
<input id="send" type="button" value="Send Date" />
<asp:ScriptManager ID="test" runat="server">
<Services>
<asp:ServiceReference Path="test.asmx" />
</Services>
</asp:ScriptManager>
2. Your JS/SQuery
<script type="javascript/text">
$(function(){
if (typeof (Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
$('#send').click(function(){
$sel1_value = $('#sel1').val();
$sel2_value = $('#sel2').val();
test.SendData($sel1_value, $sel2_value, SendSuccess, SendFailed);
});
function SendSuccess(result, eventArgs)
{
alert(result);
}
function SendFailed(error)
{
alert(error);
}
});
</script>
3. Webservice (test.asmx)
- Create a new webservice called test.asmx
- Create a new [WebMethod] called SendData in this class like so:
[WebMethod]
public string SendDate(string sel1, string sel2)
{
return "...holla! i got here last!!!";
}
Oops!!! don't forget to download and reference the latest JQuery Library in your project!
Goodluck
|
|
|
|
|
Who were you responding to?
MorgSim wrote: I hope this will help u
Hope what helps?
MorgSim wrote: use ajax to send you newely populated data back to the server.
Brilliant! Exactly what I have suggested days ago.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Mark Nischalke wrote: Hope what helps?
Your suggestion
|
|
|
|
|
|
Your query is not clear still....
Keep autopostback property of your combo box true and on SelectIndexChanged() event of ComboBox you can take the value Selected by user.
|
|
|
|
|
And where did the OP mention anything about a combobox?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I asked something like this last week but haven't gotten an answer just yet, so I thought I would ask it again in a different way. I am working on a site for our hr department to take online applications. Part of the process is allowing users to upload their resume for a job posting instead of filling out the entire application. Originally I had planned on having the resumes upload to a folder on the web server, but since we will be running a background job on the sql server to delete applicant data older than 60 days after a job posting has ended, I thought it might be better to just put the resumes into the database. What is the best practice on storing and retrieving documents in sql server using asp.net?
|
|
|
|
|
Check this[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
|
Hi All, I need to catch an event when user select an item from ListBox. I am not sure if I have to use Javascript. if yes how do I do it.
Please halp.
Thansk,
|
|
|
|
|
Hi jashimu,
Some "selectedindexchanged" event should be there you can use it.
just double click on list box you will get that event automatically.
Regards,
|
|
|
|
|
I get it it is true but when I select an item from the listBox it does not fire any even. I am not setting autopostback to true for reason.
thanks for your reply.
|
|
|
|
|
then you have to do that with javascript I think.
Only autopostback can solve your problem
|
|
|
|
|
I believe you are correct, either autopostback or Javascript
Programming is a race between programmers trying to build bigger and better idiot proof programs, and the universe trying to build bigger and better idiots, so far... the universe is winning.
|
|
|
|
|
|
hi mates,
how to alternate the position of placeholder?
here's what i did.but i want the result alternating.
client side:aspxfile
<table>
<tr>
<td>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</td>
</tr>
<tr>
<td>
<asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
</td>
</tr>
</table>
server side: page_load
For i As Integer = 1 To 3
Dim dLabel As New Label
Dim dText As New TextBox
dLabel.ID = "lblid" & i.ToString()
dLabel.Text = "label" & i.ToString()
dLabel.Width = 10
dText.ID = "txtid" & i.ToString()
dText.Text = "text" & i.ToString()
dText.Width = 10
PlaceHolder1.Controls.Add(dLabel)
PlaceHolder2.Controls.Add(dText)
Next
RESULT:
label1 label2 label3
text1 text2 text3
I WANT THE RESULT LIKE THIS:
label1
text1
label2
text2
label3
text3
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Add this line of code PlaceHolder1.Controls.Add(new LiteralControl("<br />")) before you add control label, same do for PlaceHolder2
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.cacttus.com
|
|
|
|
|
|
To get the desired results you don't need to use a table. In fact, modern web design doesn't use table layouts.
You could use a Repeater control and bind to it. The markup for the repeater could be constructed to format the lines and items in whatever configuration you would like. There is no need to use PlaceHolders.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
how to maintain scroll position of web page
|
|
|
|
|
In what version of ASP.NET? 1, 1.1, 2+?
If you are using .NET2+, you could use
<%@ Page MaintainScrollPositionOnPostback="true" %> on the page, or you could set
<pages maintainScrollPositionOnPostBack="true" /> in the pages section in web.config to set this position for all pages.
|
|
|
|
|
its not working buddy. please suggest some other
|
|
|
|
|
Throw me a bone here. What environment are you developing against? I haven't got the telepathic interface engaged here, and it's a bit too far for me to see your screen.
|
|
|
|
|
asp.net framework above 3
|
|
|
|
|
This[^] should help if you are still having a problem.
|
|
|
|