.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 21st, 2009, 01:42 AM
sasil sasil is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Location: chennai
Posts: 13 sasil User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 53 m 34 sec
Reputation Power: 0
Orkut
How to use IF statement in ASP.NEt Inline Code?

hi frnds,
i have one search page with two categories (i)Forums (ii)Blogs.
If i enter search string in textbox and check "Forums" category then click search button it returns forums topics, for that i wrote coding

Code:
<td>
<h2>
<a href='<%#forums.ForumsUtilities.GetForumURL(Eval("TopicID"),
Eval("Subject")) %>'><%# Eval("Subject") %></a>
</h2>
</td>


If i check "Blogs" then need to return blog topics in same repeater.
How to do that anyone have idea inform me... how to use if statement in Inline code.The code for blogs is,
Code:
<td>
<h2>
<a href='<%#forums.ForumsUtilities.GetBlogURL(Eval("TopicID"), Eval("Subject")) %>'><%# Eval("Subject") %></a>
</h2>
</td>

Reply With Quote
  #2  
Old March 21st, 2009, 07:21 AM
Jancarius Jancarius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 111 Jancarius User rank is Sergeant (500 - 2000 Reputation Level)Jancarius User rank is Sergeant (500 - 2000 Reputation Level)Jancarius User rank is Sergeant (500 - 2000 Reputation Level)Jancarius User rank is Sergeant (500 - 2000 Reputation Level)Jancarius User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 7 h 27 sec
Reputation Power: 13
<a href="<% If {statement} Then Response.Write("Blah Blah Blah") %>"></a>

Or Maybe:

<%
If {statement} Then
Response.Write("<a href=""url.aspx""></a>")
Else
Response.Write("<a href=""someotherUrl.aspx""></a>")
End If
%>

Reply With Quote
  #3  
Old March 21st, 2009, 11:03 AM
MadDogBrown MadDogBrown is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2009
Posts: 837 MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level)MadDogBrown User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 43 m 22 sec
Reputation Power: 526
Quote:
Originally Posted by sasil
hi frnds,
i have one search page with two categories (i)Forums (ii)Blogs.
If i enter search string in textbox and check "Forums" category then click search button it returns forums topics, for that i wrote coding

Code:
<td>
<h2>
<a href='<%#forums.ForumsUtilities.GetForumURL(Eval("TopicID"),
Eval("Subject")) %>'><%# Eval("Subject") %></a>
</h2>
</td>


If i check "Blogs" then need to return blog topics in same repeater.
How to do that anyone have idea inform me... how to use if statement in Inline code.The code for blogs is,
Code:
<td>
<h2>
<a href='<%#forums.ForumsUtilities.GetBlogURL(Eval("TopicID"), Eval("Subject")) %>'><%# Eval("Subject") %></a>
</h2>
</td>

You should be using code-behind and not inline code.

Inline code is a nightmare to maintain, and does not properly separate the presentation from the data.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > How to use IF statement in ASP.NEt Inline Code?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap