|
If You Dont Know Where to write ..!I think this is style sheet..!
So Go to the design view of the required page drag and drop the style sheet on the page..!
If i Misunderstood please explain in detail..!
Exactly what do u want to do?
What did you do?
When is the error comming..?
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
thnx a lot friend
So Go to the design view of the required page drag and drop the style sheet on the page..!
it is working for me.
|
|
|
|
|
pss.srinivasan wrote: thnx a lot friend
Any Time..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi,
You can write this in
<br />
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><br />
</asp:Content><br />
of the content page.
cheers,
sneha
|
|
|
|
|
hi what u send like that i written code but this error coming
Error 40
Cannot switch views: Validation (XHTML 1.0 Transitional):
Element 'link' cannot be nested within element 'td'.
my code is like this
<br />
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server" ><br />
<link href="../App_Themes/Blue/DefStyles.css" rel="stylesheet" type="text/css" /><br />
</asp:Content><br />
|
|
|
|
|
Hi,
You must be having a ContentPlaceHolder tag in the of the master page, you are using. Then in the content page there must be content tag having that contentPlaceHolderID. You can put the link tag in that <content>.
cheers,
sneha
modified on Tuesday, November 17, 2009 6:14 AM
|
|
|
|
|
Hi to all,
I am working on an advanced search module. It consist of 6 fields given to user to fill and search. The user can fill any one or two and may be all the fields to search. Some fields are text based and some are float.
The logic is that after taking the input, the application should check which fields are filled up by the user. And neglect the fields which are not filled from the sql query.
What I did is that, I fetched all the values from the textboxes and the values which are not empty has been added to a arraylist. Now I got the filledup values. But application will know that it is productid, description or what...
Please assist me.
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newcon"].ConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
ArrayList arl = new ArrayList();
if (TextBox1.Text.Trim() != "")
{
arl.Add("productid");
}
if (TextBox2.Text.Trim() != "")
{
arl.Add("sh_desc");
}
if (TextBox3.Text.Trim() != "")
{
arl.Add("weight");
}
if (TextBox4.Text.Trim() != "")
{
arl.Add("length");
}
if (TextBox5.Text.Trim() != "")
{
arl.Add("width");
}
if (TextBox6.Text.Trim() != "")
{
arl.Add("height");
}
for (int i = 0; i <= arl.Count; i++ )
{
if (arl[i].ToString().StartsWith("productid"))
{
}
}
cmd.CommandText = "select sh_desc,productid,price from PRODUCTS where ";
cmd.Connection.Open();
dt = new DataTable();
dt.Columns.Add("REF", typeof(string));
dt.Columns.Add("Description", typeof(string));
dt.Columns.Add("Price", typeof(float));
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
pr_id = (rdr["productid"]).ToString();
testsh_desc = (rdr["sh_desc"]).ToString();
test_price = Convert.ToSingle(rdr["price"]);
DataRow myrow = dt.NewRow();
myrow["REF"] = pr_id;
myrow["Description"] = testsh_desc;
myrow["Price"] = test_price;
dt.Rows.Add(myrow);
dt.AcceptChanges();
Session["sear"] = dt;
}
if (testsh_desc != null)
{
Response.Redirect("~/Results.aspx");
}
else
{
Response.Redirect("~/ErrorResult.aspx");
}
cmd.Connection.Close();
}
cheers,
sneha
|
|
|
|
|
Hi ,
I think u can prepare u query based on input how many valuse is filled by the user based on this u can concat string. and get result
Thanks and regards,
Amit PAtel
|
|
|
|
|
Hi Amit,
Thanks for the reply. I am the count of the values filled by the user through arraylist. Suppose I get 3 values but how I will know that these 3 values are which values. Is it a product id, description and short description or it is price, weight and length.
Please provide me an example if you have..I am confused..
cheers,
sneha
|
|
|
|
|
Hi sneha,
what i am saying u need to put if and else in ur code.
intially ur query will be like this
String query = Select * from urtablename where
if(product id!=null)
{
query = query +"product id = input"
}
if(price)
{
query =query+ add ur query;
}
thanks and regars
|
|
|
|
|
I suspect your best bet is to build your SQL based on what fields were entered.
Doing a response.redirect obviously means throwing away the results you've found, and the data that has been entered.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
you mean to say if I have 3 fields. Then I should use all the permutations and combinations.
That is if
all three are filled
none is filled
1 is not filled , 2 & 3 are filled
.
.
.
.
.
cheers,
sneha
|
|
|
|
|
Hi sneha,
what i am saying u need to put if and else in ur code.
intially ur query will be like this
String query = Select * from urtablename where
if(product id!=null)
{
query = query +"product id = input"
}
if(price)
{
query =query+ add ur query;
}
thanks and regars
amit patel
|
|
|
|
|
Ok I got it. I will try like this and came back to you with the results.
cheers,
sneha
|
|
|
|
|
Hi
u can uee dictionary collection to store key value pair.
Thanks and regards,
Amit
|
|
|
|
|
I think You have to work on the query..!
make the query parameter default as null in the store procedure
and write the store procedure depending on the params..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi,
I did that but every time result was all the products.
ALTER PROCEDURE [dbo].[ap_SearchProduct]
(
@productid nvarchar(100) = null,
@product_type nvarchar(100) = null,
@sh_desc nvarchar(4000) = null,
@weight float = null,
@length float = null,
@width float = null,
@height float = null
)
as
SET NOCOUNT ON
SELECT productid,sh_desc,price FROM PRODUCTS e
WHERE
(@productid IS NULL OR e.productid = @productid)
OR (@product_type IS NULL OR e.product_type = @product_type)
OR (@sh_desc IS NULL OR e.sh_desc = @sh_desc)
OR (@weight IS NULL OR e.weight = @weight)
OR (@length IS NULL OR e.length = @length)
OR (@width IS NULL OR e.width = @width)
OR (@height IS NULL OR e.height = @height)
return
cheers,
sneha
|
|
|
|
|
You have to keep cases..!
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
You have to go for 6 cases..!For one Case..!
SELECT productid,sh_desc,price FROM PRODUCTS e
WHERE productid = CASE WHEN @productid IS NULL
THEN productid
ELSE @productid
END
AND.....
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Hi All,
how gmail or yahoo maintain the session of different server because user can get its mail from any server.
Thanks and regards,
Amit Patel
|
|
|
|
|
What do you mean ? You mean, how to set up a web farm ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi ,
yes when i login we always retrive data from many server through only one session.
thanks and regards
Amit PAtel
|
|
|
|
|
Amit Patel1985 wrote: yes when i login we always retrive data from many server through only one session.
thanks and regards
They may use OutProc Session mode !
Have a look into this,
Exploring Session in ASP.Net[^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hello
i want to implement full text search technique in asp.net
pls provide me example
|
|
|
|
|
ASP.NET has nothing to do with full text searching, which is a function of SQL Server.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|