I have created a search box that is working fine, but I have a problem whereby I search a word and it appears everything on the database. What I really want it to do is to search for a specific word (title and content).Well on the 1st page(webform1.aspx) it works fine, but on the second page(entry.aspx) When i click a link after searching, it shows everything on the database and i don't want that to happen
DATABASE
DB name : mysearch
DB table : Blog
blogId
blogTitle
blogContents
webform1.aspx
search for something, man!
"><%# Server.HtmlEncode(Eval("BlogTitle").ToString())%>
<%#Eval("BlogContents")%>
Webform1.aspx.cs
protected void btnSubmit_Click(object sender, EventArgs e)
{
BlogDBDataContext db = new BlogDBDataContext();
dynamic q = from b in db.Blogs
where b.BlogContents.Contains(txtSearch.Text.Trim()) | b.BlogTitle.Contains(txtSearch.Text.Trim())
select b;
lv.DataSource = q;
lv.DataBind();
}
Entry.aspx
<%#Eval ("BlogTitle") %>
<%#Eval("BlogContents")%>
Entry.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
BlogDBDataContext db = new BlogDBDataContext();
dynamic q = from b in db.Blogs
select b;
lv.DataSource = q;
lv.DataBind();
}
i need help guys ASP please.
Guys the problem its on the entry page whenever i click a link on webform1 page after searching, it shows everything and i'm confused why is it like that.

Jitendra KumarRank #760 · 3K reputationPosted Jan 12, 2015, 1:10 AM EST
If any concern plz reply.
Jitendra KumarRank #760 · 3K reputationPosted Jan 9, 2015, 9:06 PM EST
In Entry page you select record in blog.
dynamic q = from b in db.Blogs
select b;
Not filtering the record.
See attached file.
If any concern plz reply.
Jitendra KumarRank #760 · 3K reputationPosted Jan 11, 2015, 5:29 PM EST
Kindly share code file for better understanding.
thokozani mlangeniRank #5,654 · 291 reputationPosted Jan 10, 2015, 2:45 PM EST
Thank you very much, great job. One more thing i can ask is how can i pass values from webform1.aspx to entry.aspx. For example whenever a user types on the textbox(webform1), therefore after typing & click search, it must pass values i search for to entry page(straight to entry.aspx) without viewing information from webform1. If you don't understand please let me know thank you.
Jitendra KumarRank #760 · 3K reputationPosted Jan 10, 2015, 4:56 PM EST
Using session and query string pass the value one to another page.
See link :-
http://www.codeproject.com/Articles/492397/State-Management-in-ASP-NET-Introduction
thokozani mlangeniRank #5,654 · 291 reputationPosted Jan 11, 2015, 5:13 PM EST
It says: value cannot be null. Parameter name:text
Error(lv.Databind();)
thokozani mlangeniRank #5,654 · 291 reputationPosted Jan 11, 2015, 5:50 PM EST
thokozani mlangeniRank #5,654 · 291 reputationPosted Jan 13, 2015, 10:09 PM EST
thokozani mlangeniRank #5,654 · 291 reputationPosted Jan 18, 2015, 10:43 PM EST