+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Call Serverside Function from A Tag

  1. #11
    Barn Frequenter noFriends is on a distinguished road noFriends's Avatar
    Join Date
    Apr 2008
    Posts
    104
    Rep Power
    3

    rr, it is in my repeater?
    Code:
    <asp:Repeater ID="rpt_Catalogue" runat="server" OnItemCommand="Cat_OnItemCommand">
    

  2. #12
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    Whoops...Sorry, must have missed that when I looked through your code...

    Did you try removing AutoEventWireup?

  3. #13
    Barn Frequenter noFriends is on a distinguished road noFriends's Avatar
    Join Date
    Apr 2008
    Posts
    104
    Rep Power
    3

    yip, it still does the same, very weird, it wont display the button.

  4. #14
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    Quote Originally Posted by noFriends View Post
    yip, it still does the same, very weird, it wont display the button.
    Hmmm...that is very odd....Something is definitely not right here...

  5. #15
    Barn Frequenter noFriends is on a distinguished road noFriends's Avatar
    Join Date
    Apr 2008
    Posts
    104
    Rep Power
    3

    awesome, for some reason its working now, lol, it when I changed " to ' around the values, this is working:
    Code:
    <asp:LinkButton ID="lb_Change" CommandName="change_Feature" CommandArgument='<%#Databinder.Eval(Container.DataItem, "ISBN13")%>' runat="server" Text='<%#Databinder.Eval(Container.DataItem, "rm_TL")%>' />
    
    or because I used Databinder.Eval?
    have a look: --Pearson Education--
    but I guess this is actually doing a repost of the page? Thought I would be able to do it without it posting? Or is it just my imagination?

  6. #16
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    Yes, I've had similar issues with double quotes when inside a repeater, but normally it throws an exception.

    In order to not do a full postback you need to use an ajax update panel, which allows asynchronous postbacks or a webservice that also uses ajax.

    Let me know if you need more info on either....I'm a fan of webservices (.asmx) which can be called from a JS function and then return an object to another JS function that can render to the screen. Obviously you need a fairly good grasp of JS for this. The update panel sorts all that out for you...

  7. #17
    Barn Frequenter noFriends is on a distinguished road noFriends's Avatar
    Join Date
    Apr 2008
    Posts
    104
    Rep Power
    3

    can you say that again in Engrish please

    Will have a look at some examples, this will do for now

    Thanks again!

  8. #18
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    Sorry. If I was you, probably just stick to the update panel...It's pretty easy to follow. Try the www.asp.net ajax tutorials.

    ASP.NET AJAX Videos : The Official Microsoft ASP.NET Site

  9. #19
    Wolfmaster Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy is a splendid one to behold Wolffy's Avatar
    Join Date
    Mar 2008
    Location
    Peoria, IL
    Posts
    1,037
    Blog Entries
    2
    Rep Power
    13

    Just for the lurkers following this thread, this was the problem:
    CommandArgument="<%#Container.DataItem("ISBN13")%> "
    The function Container.DataItem takes a String argument, so the double quotes around the ISBN13 is correct -- however, this double quote also terminates the string <%#Container.DataItem(. Thus, when using DataItem (or Eval) you should always use single quotes around the argument,
    CommandArgument='<%#Container.DataItem("ISBN13")%> '
    Wolffy
    ------------------------
    Opinions expressed are my own and do not necessity reflect those of any sane person. Any code provided is intended to be an example and is provided AS IS. Rework for your specific environment may be required. Void where prohibited by law. Not valid in California. Your mileage may vary.

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. How to call a .js file in my form?
    By dtz in forum JavaScript Programming
    Replies: 9
    Last Post: July 28th, 2009, 06:28 AM
  2. Help with JS function
    By Wolffy in forum JavaScript Programming
    Replies: 1
    Last Post: June 9th, 2009, 09:52 AM
  3. Help using function
    By Rebelle in forum ASP Development
    Replies: 11
    Last Post: October 13th, 2008, 12:13 PM
  4. without function
    By guddu in forum Microsoft SQL Server
    Replies: 1
    Last Post: July 15th, 2008, 04:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO