|
Google is the best guy.
Regards
Saanj
There is no foolish question, there is no final answer...
|
|
|
|
|
sandhya.sa wrote: kindly help me in finding it
Did you check out Google Maps? That would give you directions to any place on earth now and you can easily find it.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
i m using asp.net with c#
i submit some value in database
and then access it
i m trying to do when any fiels contain 0 value then labels visibility should be false.
i m doing like this
cmd.CommandText = "select * from invoice where invoice_no=(Select max(invoice_no) from invoice)";
adp.Fill(ds, "re");
foreach (DataRow dr in ds.Tables["re"].Rows)
{
Label49.Text = dr["invoice_no"].ToString();
Label2.Text = dr["indate"].ToString();
Label9.Text = dr["po_no"].ToString();
Label10.Text = dr["dc_no"].ToString();
Label11.Text = dr["comp_name"].ToString();
Label13.Text = dr["tin_no"].ToString();
Label68.Text = dr["total_vat"].ToString();
Label27.Text = dr["prod1"].ToString();
if (dr["prod2"].ToString() == 0)
{
Label28.Visible = false;
}
else
{
Label28.Text = dr["prod2"].ToString();
}
but it will give error
how i'll do if prod2 contain null or 0 value then label28.visible=false;
plsease help me
thanks in advance
|
|
|
|
|
prateekfgiet wrote: Label49.Text
prateekfgiet wrote: Label68
For the poor bugger (including you in a couple of months time) that will have to maintain this code, please name these things properly. Label49 or Label68 are not an acceptable names.
prateekfgiet wrote: if (dr["prod2"].ToString() == 0)
You are converting the value to a string, then comparing it with an integer. Why not keep both sides as integers or convert both sides to strings?
Man who stand on hill with mouth open wait long time for roast duck to drop in
|
|
|
|
|
Something like this
if( DBNull.Value.Equals( dr["prod2"] ) || dr["prod2"].ToString() == "0")
Label28.Visible = false;
else
Label28.Text = dr["prod2"].ToString();
Using the wrong tool for the job is half the fun.
|
|
|
|
|
prateekfgiet wrote: but it will give error
how i'll do if prod2 contain null or 0 value then label28.visible=false;
Don't call the ToString() before doing a NULL check. Do something like
if (dr["prod2"] != null)
{
string prod2 = dr["prod2"].ToString();
Label28.Visible = !(prod2 == "0");
Label28.Text = prod2;
}
|
|
|
|
|
Hi,
I am trying to load images in my login page,but they are
not getting displayed.I am also using image button for
images of submit and reset.Tried using ~ but still not
getting displayed.
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/img snip.jpg" Style="z-index: 100;left: 78px; position: absolute;
top: 189px" AlternateText="img" />
scarface
|
|
|
|
|
scar_face wrote: am trying to load images in my login page,but they are
not getting displayed
Check your image path is valid or not !!
|
|
|
|
|
Right click on the cross image and check the path which is it taking. You can also view the source and check the path from which the image is mapped. It is preferred to set the image path dynamically in the code-behind with the fully qualified virtual path like shown below:
img1.Src = "http://localhost/demoapp/images/img_bak.gif";
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
i had tried givin that path but it dint work ..
scarface
|
|
|
|
|
You have to remove the image path from the image definition in aspx as well. Try to check what is the image url (virtual path) and then paste it into that code. Are you trying it in your localhost or somewhere else? If it is not in localhost then permission can be an issue. Just paste image path that you are specifying in the code, in the browser and check manually whether the image is getting displayed or not.
There is no foolish question, there is no final answer...
|
|
|
|
|
Is it possible that only logged in members have permission to view these images ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
thanks christian.. i think thats the reason..checking on it..
scarface
|
|
|
|
|
hi sir
i have used following code but got same error "the server tag is not well formed".
" width="9px" border="0" src="images/plus.gif"/>
sorry sir
i will keep it mind.i was new in code project so i don't know about how to ask another question of same topic.
i have used following code but got same error "the server tag is not well formed".
alt=<%# "Click to show/hide StatusDetail" + Eval("Item_Code")%> runat ="server" width="9px" border="0" src="images/plus.gif"/>
modified on Thursday, June 11, 2009 5:22 AM
|
|
|
|
|
Please stop creating new threads.
Regards
Saanj
Either you love IT or leave IT...
|
|
|
|
|
Don't create new thread for your same question.Don't you know how to continue posting on your previous thread?!
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
You may have problem in
vikas shukla wrote: alt="Click to show/hide StatusDetail <%# Eval("Item_Code") %>"
try this
alt=<%# "Click to show/hide StatusDetail" + Eval("Item_Code") %>
|
|
|
|
|
I am trying to check a check box in a repeater
If I use -
Checked='<%# Eval("Checked") %>'
I get the error -
Specified cast is not valid.
So I tried -
Checked='<%# (Eval("Checked") == "True").ToString() ? True : False %>'
And got the error -
Compiler Error Message: CS0103: The name 'True' does not exist in the current contextCompiler Error Message: CS0103:
Any ideas?
Thanks!
|
|
|
|
|
the_smiths wrote: (Eval("Checked") == "True").ToString() ? True : False
That is the weirdest thing I have ever seen. Did you mean to do a boolean compare on a string ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Christian Graus wrote: That is the weirdest thing I have ever seen
You need to get out more!
But seriously, you are right.
It was a silly mistake, I had my datacolumn as type string instead of a boolean.
Now fixed! Thanks for your reply.
|
|
|
|
|
hi sir
i am using nested gridview for some specific purpose.so i have expand/collapse sign for see and hide the child gridview.
but sir now i do not want expand sign for all rows.means for some rows child gridview has not any information.so i want hide that expand picture for that row.
" alt="Click to show/hide StatusDetail <%# Eval("Item_Code") %>" width="9px" border="0" src="images/plus.gif"/>
please help me.
thanx
sir your suggestion was good but now i am facing following error after adding runat="server"
"The server tag is not well formed."?
please guide me.
|
|
|
|
|
There was no need to start a new thread. You could have used the old thread itself.
vikas shukla wrote: "The server tag is not well formed."?
I guess you have to use single quote(' ) instead of double quotes(" ). Something like img id='imgdiv<%#Eval("Item_Code") %>'
|
|
|
|
|
Hi,
I am trying to serialize an object, I am getting exception as
"Unable to cast object Type A to Type B".
Please help me in finding soultion
Thanks,
Mini
Best Regards,
Mini Thomas
|
|
|
|
|
miniThomas wrote: "Unable to cast object Type A to Type B".
Error message is clear enough, right?
miniThomas wrote: Please help me in finding soultion
You need to post more information with relevant code if you are expecting help.
|
|
|
|
|
N a v a n e e t h wrote: You need to post more information with relevant code if you are expecting help.
And he needs to not cross post
|
|
|
|