Manikavelu Velayutham
posted
682 posts
since
Jun 25, 2010
from
|
|
Re: Link word to google search
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If you find my post helpful, Mark it as Answered or Rate the post.
|
|
|
|
|
|
sam
posted
69 posts
since
Jul 04, 2010
from
|
|
Re: Link word to google search
|
|
|
|
|
|
|
|
|
|
|
Hi Mani, where do i apply/modify the code?
|
|
|
|
|
|
Manikavelu Velayutham
posted
682 posts
since
Jun 25, 2010
from
|
|
Re: Link word to google search
|
|
|
|
|
|
|
|
|
|
Just put a hyperlink button in the gridview, and whenver you add the value from the text box to the grid. Just do it as below
string str = "http://www.google.co.in/search?hl=en&source=hp&q=XXXX&aq=f&aqi=g2g-s1g1g-s1g1g-s4&aql=&oq=&gs_rfai=";
str.replace("XXXX",textbox1.text);
finally store this string in the URL property of hyperlink button of the gridview.
First try with the label itself, if its doesnt work, put the hyperlink button and test it.
Surely it should work
dont forget to mark this post as answered or mark it as good post.
|
|
|
|
|
If you find my post helpful, Mark it as Answered or Rate the post.
|
|
|
|
|
|
sam
posted
69 posts
since
Jul 04, 2010
from
|
|
Re: Link word to google search
|
|
|
|
|
|
|
|
|
|
|
Hi Mani..so sorry,i m new to this asp.net..
I have a code here : [code] <head runat="server"> <title>Untitled Page</title> <script runat="server"> protected void AddPersonButton_Click(object sender, EventArgs e) { ArrayList peoplearraylist = new ArrayList(); if (ViewState["people"] != null) { peoplearraylist = (ArrayList)ViewState["people"]; } else { peoplearraylist = new ArrayList(); } string firstname = FirstNameTextBox.Text; string lastname = LastNameTextBox.Text;
Person addperson = new Person(firstname, lastname); peoplearraylist.Add(addperson); ViewState["people"] = peoplearraylist; FirstNameTextBox.Text = ""; LastNameTextBox.Text = ""; DisplayListOfPeople(); }
protected void DisplayListOfPeople() { ShowPeople.Text = ""; ArrayList peoplearraylist = new ArrayList(); if (ViewState["people"] != null) { peoplearraylist = (ArrayList)ViewState["people"]; foreach (Person currentperson in peoplearraylist) { ShowPeople.Text += currentperson.Firstname + " " + currentperson.Lastname + "<br />"; } } } </script> </head> <body> <form id="form1" runat="server"> <div> First Name: <asp:TextBox ID="FirstNameTextBox" runat="server"></asp:TextBox><br /><br /> Last Name: <asp:TextBox ID="LastNameTextBox" runat="server"></asp:TextBox><br /><br /> <asp:Button ID="AddPersonButton" runat="server" Text="Add" onclick="AddPersonButton_Click" /> <br /><br /> <asp:Label ID="ShowPeople" runat="server" />
</div> </form> </body> [/code]
when i enter value in the textbox,it will temporarily display the value at the bottom. lets say i enter company 1 in first textbox,company 1 will be displayed as a label at bottom. i want the name company 1 word is linked to google search when when we click the company 1,it will automatically display google search results as company 1.
|
|
|
|
|
|
sam
posted
69 posts
since
Jul 04, 2010
from
|
|
Re: Link word to google search
|
|
|
|
|
|
|
|
|
|
I got it (for my first code post)
<ItemTemplate> <a href='http://www.google.com/#q=<%# Eval("name")%>'> <%#Eval("name")%></a> </ItemTemplate>
But now i have an iframe and want the page redirected to this iframe. Any ideas? My iframe code : <iframe runat="server" id="iframe1" src="" style="height: 300px; width: 635px" frameborder="0"></iframe>
|
|
|
|
|
|