Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to make a Search Cloud in ASP.NET C#

Posted on 2010-11-07
8
Medium Priority
?
619 Views
Last Modified: 2012-08-13
How can I make a webpage with multiple URLs ? (for a Search Cloud control)
I want
http://mywebsite.com/Default.aspx

to be able to access with multiple URLs like
http://mywebsite.com/Tag1.aspx
http://mywebsite.com/Tag2.aspx
...

I already have the tagcloud control, but I don't know how to address a single webpage from multiple URLs.

Thanks !
0
Comment
Question by:evo_x
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
8 Comments
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 34081838
I think the fact that you're using a TagCloud control is to some extent irrelevant...would it be fair to say that the question is how to open a single ASPX page using different names?
1. You can use a QueryString, making your urls http://mywebsite.com/Default.aspx, http://mywebsite.com/Default.aspx?tag=Tag1 and http://mywebsite.com/Default.aspx?tag=Tag2.  Then in Page_Load you can check the query string:
string requestedTag;
if(Request.QueryString.AllKeys.Contains("tag"))
    requestedTag = Request.QueryString["tag"];

2. You can use URL re-writing - it's a bit more involved but can make the URL's a little easier to read.
0
 
LVL 2

Author Comment

by:evo_x
ID: 34083110
I want to make it with URL re-writting, I already have pages in my website with rewritten URLs, but I don't know how to implement the tags...
0
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 34083625
What tag control are you using?
0
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 
LVL 2

Author Comment

by:evo_x
ID: 34085282
from Telerik
0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 2000 total points
ID: 34090144
I'm still not really sure what your question is... initially you said How can I make a webpage with multiple URLs ... I don't know how to address a single webpage from multiple URLs, but then you also said  I already have pages in my website with rewritten URLs, but I don't know how to implement the tags...
So here's a an example of a page with a RadTagCloud, the items are statically defined in the <Items> element.  AutoPostBack is true for the TagCloud (so that events, like a click, fire immediately), and I've added an event handler for the TagCloud's ItemClick event.
In that event handler I get the item that was clicked and redirect the browser to the URL /CloudTags/xyz where xyz is replaced by the tag text that was clicked (for example the user might be redirected to /CloudTags/Start).
You would need to use URL re-writing to make that request go to an actual file (but you said you already have that done, so I haven't covered it here).

<%@ Page Language="C#" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

	protected void RadTagCloud1_ItemClick(object sender, RadTagCloudEventArgs e)
	{
		Response.Redirect(String.Format(
			"~/CloudTags/{0}", e.Item.Text));
	}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
		<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
		</telerik:RadScriptManager>
		<telerik:RadTagCloud ID="RadTagCloud1" runat="server" 
			onitemclick="RadTagCloud1_ItemClick" AutoPostBack="True">
			<Items>
				<telerik:RadTagCloudItem Text="ASP.NET" Weight="12" />
                <telerik:RadTagCloudItem Text="AJAX" Weight="134" />
                <telerik:RadTagCloudItem Text="VB" Weight="56" />
                <telerik:RadTagCloudItem Text="C#" Weight="38" />
                <telerik:RadTagCloudItem Text="Web" Weight="73" />
                <telerik:RadTagCloudItem Text="jQuery" Weight="23" />
                <telerik:RadTagCloudItem Text=".NET" Weight="78" />
                <telerik:RadTagCloudItem Text="Code" Weight="50" />
                <telerik:RadTagCloudItem Text="UI" Weight="80" />
                <telerik:RadTagCloudItem Text="Unit" Weight="20" />
                <telerik:RadTagCloudItem Text="Class" Weight="50" />
                <telerik:RadTagCloudItem Text="Tools" Weight="40" />
                <telerik:RadTagCloudItem Text="Dynamic" Weight="58" />
                <telerik:RadTagCloudItem Text="Telerik" Weight="60" />
                <telerik:RadTagCloudItem Text="HTTP" Weight="64" />
                <telerik:RadTagCloudItem Text="Start" Weight="62" />
                <telerik:RadTagCloudItem Text="Response" Weight="23.7" />
                <telerik:RadTagCloudItem Text="Client-side" Weight="55" />
                <telerik:RadTagCloudItem Text="Default" Weight="8.5" />
                <telerik:RadTagCloudItem Text="Event" Weight="45" />
                <telerik:RadTagCloudItem Text="Property" Weight="24" />
                <telerik:RadTagCloudItem Text="Tests" Weight="81" />
                <telerik:RadTagCloudItem Text="Method" Weight="87" />
                <telerik:RadTagCloudItem Text="DataSource" Weight="34" />
                <telerik:RadTagCloudItem Text="JavaScript" Weight="35.70" />
                <telerik:RadTagCloudItem Text="Server-side" Weight="59.3" />
                <telerik:RadTagCloudItem Text="Accessibility" Weight="15.7" />
                <telerik:RadTagCloudItem Text="HTML5" Weight="90" />
                <telerik:RadTagCloudItem Text="XHTML" Weight="47.8" />
                <telerik:RadTagCloudItem Text="Compliance" Weight="29.45" />
                <telerik:RadTagCloudItem Text="Callback" Weight="53" />
                <telerik:RadTagCloudItem Text="Request" Weight="39.3" />
                <telerik:RadTagCloudItem Text="Postback" Weight="9.5" />
                <telerik:RadTagCloudItem Text="DOM" Weight="65.49" />
                <telerik:RadTagCloudItem Text="Markup" Weight="35.49" />
                <telerik:RadTagCloudItem Text="Trigger" Weight="24.975" />
                <telerik:RadTagCloudItem Text="XML" Weight="43.975" />
                <telerik:RadTagCloudItem Text="CSS" Weight="14.392" />
                <telerik:RadTagCloudItem Text="Object" Weight="85.6" />

			</Items>
		</telerik:RadTagCloud>
    </div>
    </form>
</body>
</html>

Open in new window

0
 
LVL 2

Author Comment

by:evo_x
ID: 34091999
Thanks!
So I need a database which contains the Tags and associated Routes in order to manage the routing?
Maybe it is better with the QueryString like in your first post and then handle the routes for that?
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 34280964
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question