|
Just try to debugg your application by putting break point to your line of codes and check what value are you getting here
a-+s-+p-+ wrote: string help = Request.QueryString["help"].ToString();
There is no need of calling ToString() method
Request.QueryString["help"].ToString();
as Request.QueryString["help"]; returns string
and try to use String class method and properties like
String.IsNullOrEmpty / String.Equals instead of Checking for null and comparing two strings
I think this is the best way which can help you now and in future also
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
modified on Wednesday, February 13, 2008 5:01 AM
|
|
|
|
|
ok thanks
sorted it in the end
cheers
|
|
|
|
|
playing with bugs ) wrote: and try to use String class method and properties like
String.IsNullOrEmpty / String.Equals instead of Checking for null and comparing two strings
If you want to check if the string is null or empty, the String.IsNullOrEmpty method is ideal, but if you only want to check if the string is null, that can not be done any other way than just comparing with null.
The == operator is overloaded in the string class so that you can use it to compare strings. This is the intuitive way of comparing strings, and it works just fine. The String.Equals method can be used if you want some functionality that the == operator doesn't cover, like case insensetive comparison.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Well, i will have to share these factors also while giving any suggestions regarding String class any way well said Guffa
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I am working on ASP.NET application which uses basic authentication.
What I want to achieve is, if a user types a wrong credentials, he should be redirected to a custom error page.
I know that this cannot be achieved using Custom Errors section of ASP.Net as it happens much before that. Something has to be done at IIS level.
But what is to be done, I am not sure…
|
|
|
|
|
Well, now I can redirect the user on providing the wrong credentials…
But the wired thing happening is, the redirected page only renders the static text and not my ASP.Net controls…Grrr
|
|
|
|
|
wats up!just started asp.net 2003 and was jus wonderin how do i automatically create a new directory for every new user in order for him/her to store videos in that directory.
|
|
|
|
|
You use the System.IO.Directory.CreateDirectory method or the System.IO.DirectoryInfo.Create method.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
thank you man! it did work.
|
|
|
|
|
Hi
I have a probably quite easy question but which drives me crazy!
I am using a Gridview in my web page. I bind with a sqldatasource and gridview displays all data correctly.
But i want gridview to display an another string instead of the data in database.
For example :
There is a field named "isexists" in my table having 1 or 0 data.
But on the web page , i want to show that column data as "YES" (instead of 1) and "NO" (instead of 0) in gridview.
Could you please help me about this?
Thanks and Regards
mcbulan
|
|
|
|
|
mustafa bulan wrote: But on the web page , i want to show that column data as "YES" (instead of 1) and "NO" (instead of 0) in gridview.
Either you can do this in the query or in row_databound event of GridView. In this event check the value, if value is 0 set the cells text as "NO" else "YES".
|
|
|
|
|
thankx for your reply.
but how i check the current value at that record?
i need to know some codes like :
// rowdatabound event
if gridview1.rows(?).cells(??).text = "1" then
gridview1.rows(?).cells(??).text = "YES"
else
gridview1.rows(?).cells(??).text = "NO"
|
|
|
|
|
RowDatabound has two arguments
object and events e
you can go by
e.cells("").value
|
|
|
|
|
I have been doing similar checks using functions and the Eval keyword... i.e.
...Text='<%# ACunningFunction(Eval("db_field_name")) %>'
Which would require something like:
protected string ACunningFunction(object db_field)
{
}
Are there any performance implications in doing it this way?
|
|
|
|
|
This is a fair approach and I don't think about any performance issues.
|
|
|
|
|
Hi
I m new biew to Asp.net(Vb)
I wanna use Adrotator in my page which shows the images from database
(Means the url of image is stored in database and images is saved in a folder)
For it i simply retrived all image url in dataset and bind it to the adrotator but it not worked properly
My code is:
Dim sql As String
sql = "select ImageURL,NavigateURL,AlternateText,Keyword from image"
ad = New SqlDataAdapter(Sql, cnn)
ad.SelectCommand.CommandType = CommandType.Text
Me.ds = New DataSet
Me.ad.Fill(ds)
Me.cnn.Close()
Me.AdRotator1.DataSource = Me.ds.Tables(0)
Me.AdRotator1.DataBind()
and the image url is like this : -
~/Add_Image/middle.gif
It shows dynamic alternatetext each time when i refresh the page but don't show image
Show me the currect way to do it Plz
Thanks with anticipation
|
|
|
|
|
I have a textbox, I want that customer can only read its text but problem arises when text exceeds from the width of the textbox. In normal case we can read all the text by using arrow keys. How can I read text when textbox is read only?
Regards, Qaiser Nadeem
|
|
|
|
|
If you are not allowing customer to edit the field, why textbox is used ? Try to use Label/Literal instead.
|
|
|
|
|
Text area may be another option
--Akki
|
|
|
|
|
A web application is developed using .Net framework 1.1 , Visual studio 2003, on windows 2003 server. Now application is exported to new machine with both the versions of .Net framework installed on it , i.e 1.1 and 2 ... The machine carries both the development environments, VS 2003 and VS 2005. The error resulting in opening the application is stated as " Web server is not running Asp.net version 1.1. you will be unable to run asp.net web applications or services" .
With the help of MSDN I have gone through almost all the solutions , includiong reinstalling the correct version of asp.net 1.1.4322, setting right version of asp.net in default web site settings, allowing asp.net 1.1 and asp.net 2 versions in web server extension settings .. resulting not a solution .. can anyone help in that .
Regards,
Madni
Madni
|
|
|
|
|
Again are u gettting the same error?
Sachin Mukhija
|
|
|
|
|
yes ... still i am getting the same error .. also i created an aspx file namely "get_aspx_ver.aspx" as directed in msdn , copied it on wwwroot folder , and adding "location" value in the web.config file .... No solution found yet .. :-S
Madni
|
|
|
|
|
Hi ,
i am using asp.net2.0 , C#
I have four row of table(in aspx form). I display only one row based on condition out of four and make other rows invisible but it still consume the space Is it posible that to TD OR TR wherein control are invisible row do not consume the space . i am not generating controls dynamically as it is affecting the alingment of control .
Please guide me.
Thank you
regards
imran khan
|
|
|
|
|
Did you try applying a style like
display:none ?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
i tried display : none but it remove the control that are visible.
regards
imran khan
|
|
|
|