DeveloperBarn Forums

DeveloperBarn

Programming & IT forum

Call Serverside Function from A Tag

This is a discussion on Call Serverside Function from A Tag within the .Net Development forums, part of the Programming & Scripting category; rr, it is in my repeater? Code: <asp:Repeater ID="rpt_Catalogue" runat="server" OnItemCommand="Cat_OnItemCommand">...

Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

  #11  
Old June 29th, 2009, 07:01 AM
Barn Regular
 
Join Date: Apr 2008
Posts: 84
Rep Power: 2
noFriends is on a distinguished road
Default

rr, it is in my repeater?
Code:
<asp:Repeater ID="rpt_Catalogue" runat="server" OnItemCommand="Cat_OnItemCommand">
Reply With Quote
  #12  
Old June 29th, 2009, 07:19 AM
richyrich's Avatar
Administrator
 
Join Date: Mar 2008
Real name: Rich
Location: Somewhere only we know...
Posts: 1,345
Blog Entries: 6
Rep Power: 8
richyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to all
Default

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

Did you try removing AutoEventWireup?
__________________
Join the folding team
Reply With Quote
  #13  
Old June 29th, 2009, 07:28 AM
Barn Regular
 
Join Date: Apr 2008
Posts: 84
Rep Power: 2
noFriends is on a distinguished road
Default

yip, it still does the same, very weird, it wont display the button.
Reply With Quote
  #14  
Old June 29th, 2009, 07:38 AM
richyrich's Avatar
Administrator
 
Join Date: Mar 2008
Real name: Rich
Location: Somewhere only we know...
Posts: 1,345
Blog Entries: 6
Rep Power: 8
richyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to all
Default

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...

Comments on this post
noFriends agrees: thanks for all the help RR!
Reply With Quote
  #15  
Old June 29th, 2009, 07:46 AM
Barn Regular
 
Join Date: Apr 2008
Posts: 84
Rep Power: 2
noFriends is on a distinguished road
Default

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?
Reply With Quote
  #16  
Old June 29th, 2009, 07:56 AM
richyrich's Avatar
Administrator
 
Join Date: Mar 2008
Real name: Rich
Location: Somewhere only we know...
Posts: 1,345
Blog Entries: 6
Rep Power: 8
richyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to all
Default

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...
Reply With Quote
  #17  
Old June 29th, 2009, 08:15 AM
Barn Regular
 
Join Date: Apr 2008
Posts: 84
Rep Power: 2
noFriends is on a distinguished road
Default

can you say that again in Engrish please

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

Thanks again!
Reply With Quote
  #18  
Old June 29th, 2009, 08:44 AM
richyrich's Avatar
Administrator
 
Join Date: Mar 2008
Real name: Rich
Location: Somewhere only we know...
Posts: 1,345
Blog Entries: 6
Rep Power: 8
richyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to allrichyrich is a name known to all
Default

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
Reply With Quote
  #19  
Old June 29th, 2009, 09:59 AM
Wolffy's Avatar
Wolfmaster
 
Join Date: Mar 2008
Real name: Wolff
Location: Peoria, IL
Posts: 779
Blog Entries: 1
Rep Power: 9
Wolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to beholdWolffy is a splendid one to behold
Default

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")%> '

Comments on this post
richyrich agrees: Thanked Post
__________________
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 With Quote
The Following User Says Thank You to Wolffy For This Useful Post:
richyrich (June 29th, 2009)
Reply

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

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


All times are GMT -4. The time now is 05:13 PM.


Copyright ©2008-2010, DeveloperBarn

Content Relevant URLs by vBSEO 3.3.2