Click here to Skip to main content
15,886,799 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: 2010 web form problem Pin
R. Giskard Reventlov31-May-12 15:20
R. Giskard Reventlov31-May-12 15:20 
AnswerRe: 2010 web form problem Pin
taha bahraminezhad Jooneghani3-Jun-12 2:48
taha bahraminezhad Jooneghani3-Jun-12 2:48 
Questioncalling a function from a hyperlink Pin
wiins31-May-12 8:08
wiins31-May-12 8:08 
AnswerRe: calling a function from a hyperlink Pin
jkirkerx31-May-12 13:30
professionaljkirkerx31-May-12 13:30 
GeneralRe: calling a function from a hyperlink Pin
wiins31-May-12 22:15
wiins31-May-12 22:15 
GeneralRe: calling a function from a hyperlink Pin
jkirkerx1-Jun-12 6:57
professionaljkirkerx1-Jun-12 6:57 
GeneralRe: calling a function from a hyperlink Pin
wiins8-Jun-12 4:46
wiins8-Jun-12 4:46 
GeneralRe: calling a function from a hyperlink Pin
jkirkerx8-Jun-12 10:53
professionaljkirkerx8-Jun-12 10:53 
wiins wrote:
but what I really need to do here is to return some data from the server based on what the user has clicked.

I would use a span tag because it's inline, and won't change the format of the paragraph text. Many buttons just use a span tag for formatting, and are backed by Jquery or Javascript.

I want to buy a notebook computer today
I want to buy a notebook computer today

Then in JQuery, you add a bind to the class for the click event, pick up the click, get the word, transmit it via $.Ajax to the Web Service, get a response back, figure out what to do.

[Code]: the code is just for conveying the concept, it does not work.

C#
$(document).ready(function () {
    initiateBinding();

    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

});

function EndRequestHandler(sender, args) {
    initiateBinding();
}

function initiateBinding() {
    //Bind events here

    // Listen for all specialWord Clicks
    $('.specialWord').click(function () {
        var theWord = $(this).html();         // Read text in span tag
        var newPage = runWebService(theWord); // Run Service, get instructions
        window.location = newPage             // You can redirect them
        $(this).empty();                      // Dump text in span tag
        $(this).appendTo("new text");         // change text in span tag
        return false;
    });
}

function runWebService(theWord) {

   // Make your $.Ajax call to the web service
   [edit]: window.location = "newpage.aspx";
   return newPage;
   [3rd edit] take the response, and populate the container using .empty()    .appendTo(" la la la"") to the new container.

   var newText = objB.newText;
   $('newContainer).empty();
   $(newText).delay(250).appendTo($('newContainer'));

}


Like I said, just an idea of one way to do it on the client side, with web services on the server side to make decisions.

modified 8-Jun-12 17:09pm.

Question'cmbGender' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value Pin
mudunurusv30-May-12 23:36
mudunurusv30-May-12 23:36 
AnswerRe: 'cmbGender' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value Pin
Sandeep Mewara31-May-12 0:43
mveSandeep Mewara31-May-12 0:43 
QuestionGridview in Repeater Pin
zeeShan anSari30-May-12 4:33
zeeShan anSari30-May-12 4:33 
AnswerRe: Gridview in Repeater Pin
Sandeep Mewara30-May-12 10:17
mveSandeep Mewara30-May-12 10:17 
GeneralRe: Gridview in Repeater Pin
Apocalypse Now31-May-12 15:17
Apocalypse Now31-May-12 15:17 
GeneralRe: Gridview in Repeater Pin
Sandeep Mewara31-May-12 16:42
mveSandeep Mewara31-May-12 16:42 
GeneralRe: Gridview in Repeater Pin
Apocalypse Now1-Jun-12 15:19
Apocalypse Now1-Jun-12 15:19 
AnswerRe: Gridview in Repeater Pin
wikizhao31-May-12 22:26
wikizhao31-May-12 22:26 
AnswerRe: Gridview in Repeater Pin
taha bahraminezhad Jooneghani3-Jun-12 2:09
taha bahraminezhad Jooneghani3-Jun-12 2:09 
QuestionFind index or row in gridview with RadioButton Pin
Franco Cipriano30-May-12 4:03
Franco Cipriano30-May-12 4:03 
AnswerRe: Find index or row in gridview with RadioButton Pin
Sandeep Mewara30-May-12 10:11
mveSandeep Mewara30-May-12 10:11 
GeneralRe: Find index or row in gridview with RadioButton Pin
Franco Cipriano30-May-12 10:35
Franco Cipriano30-May-12 10:35 
GeneralRe: Find index or row in gridview with RadioButton Pin
Sandeep Mewara30-May-12 10:41
mveSandeep Mewara30-May-12 10:41 
GeneralRe: Find index or row in gridview with RadioButton Pin
Franco Cipriano31-May-12 4:44
Franco Cipriano31-May-12 4:44 
GeneralRe: Find index or row in gridview with RadioButton Pin
Sandeep Mewara31-May-12 5:06
mveSandeep Mewara31-May-12 5:06 
Questionget the file path in web project when running unit test project Pin
siva45530-May-12 0:34
siva45530-May-12 0:34 
AnswerRe: get the file path in web project when running unit test project Pin
Sandeep Mewara30-May-12 2:26
mveSandeep Mewara30-May-12 2:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.