|
well its just not reading the if statement because i have this:
if (GridView4.Rows.Count < 1)
{
lbsearchcriteria.Text = "No results found";
}
else if (GridView4.Rows.Count > 0)
{
do something
}
but it performs the second if statement even if no rows are displayed
is the if statement incorrect?
thanks
|
|
|
|
|
No..But why you require another if after else
if (GridView4.Rows.Count < 1)
{
lbsearchcriteria.Text = "No results found";
}
else
{
do something
}
This is same right ?.
May be you can try this ?(Dont ask me the thought behind it )
if (GridView4.Rows.Count > 0)
{
do something
}
else
{
lbsearchcriteria.Text = "No results found";
}
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
ok thansk i will try that
cheers1
|
|
|
|
|
Hi All,
My .net application automatically creates .tmp files, and are written to c:\winnt\temp folder. Now when the users access the application, they also shd be having the permission to c:\winnt\temp folder of server to allw writing .tmp files, or else will get error as Compiler Error Message: CVT1108: cannot open C:\WINNT\TEMP\RES4F42.tmp for writing. After manually giving authenticated users 'Write' Permission to C:\WINNT\TEMP\, Application runs perfectly.
This is only a temp soln, after sometime the the c:\winnt\temp folder will not allow authenticated users to write (the write permission would have been unchecked automatically).
Is it possible to redirect .tmp files to different folder other than c:\winnt\temp
Any suggestions please..
Girija
|
|
|
|
|
Add this lines
using System.Security.Permissions;
.
.
.
[assembly: FileIOPermission(SecurityAction.RequestMinimum,Unrestricted=true)]
class test
{
}
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
Hi,
We can't find out which pages writes to c:\winnt\temp folder, in that case how can I include the above code application level.
Thanks,
Giri
|
|
|
|
|
In that case you will have to use CasPol utility that comes with .net Frame work to provide permissions to your assembly.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
How does it 'automatically' create temp files. Can you not just change this code to output to a different directory?
|
|
|
|
|
I believe when .net applications are running, creates .tmp files automatically and by default they are written to C:\WINNT\Temp folder. Even I tried for IIS options to redirect the .tmp files to different folder, no use
|
|
|
|
|
I've worked with a number of asp.net applications and never encountered this as a problem. You might want to check how your framework was installed and also if you have a draconian security policy, you need to get an admin to sort something out to permit your application to work.
|
|
|
|
|
how to implement such functionality in asp.net
|
|
|
|
|
A timer is not a control, it's a class, it's just offered in the forms designer for people who are incapable of writing code and who need designers to create forms.
I recommend you buy a book on ASP.NET and work through it. As your ASP.NET code runs on the server, it's obvious you can't impliment a timer in code behind. You need to use javascript for that, because that's the language that runs on the client. You can force a postback on your timer, do things in the UI, or make an AJAX call.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
it depends how you want your timer to work
I have a similar method to a timer working at the moment
I have a page which 5 minutes after a user accesses it, it changes state, i.e. automatcially refreshes and something happens
explain more about how you want a timer to work
|
|
|
|
|
Yes, sure, so you can do that with javascript, like I said ( I said, javascript can do a postback )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You may need to use JavaScript and try setTimeout function.
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
|
|
|
|
|
ajax framework comes with a
"Timer Control".
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
*sigh* but who needs an 'AJAX' control to set a javascript timeout ? Really ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Of course we dont need it .But i was just stressing on the word "Timer Control". In a sense just like your Forms "Timer control" it can fire a event and run a code behind.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
can any body help me to save an image file located in one folder to another folder using c# ASP.NET
abeesmuhammed
|
|
|
|
|
System.IO.File.Copy(sourcefile,destfile) . Use Server.MapPath to get your files real location.
|
|
|
|
|
Is it possible to Apply rounded corners for a ASP Button using CSS?If so can yyou provide me any links
Many Thanks
|
|
|
|
|
http://www.devarticles.com/c/a/JavaScript/Building-Rounded-Corners-With-CSS-and-JavaScript/
http://aspnet.4guysfromrolla.com/articles/072804-1.aspx
|
|
|
|
|
Hi, i have a small doubt.
My requirement is to write a exception to eventlog file whatever exception rises throughout the applciation. So, using application_error method in global.asax page, i can write entry to eventlog file..it is ok for me..
But my doubt is how to retrive the application error to global.asax file..
When ever error occurs...applciation_error event will fired. But how to get that exception?
please help me on this
Thank You
G. Satish
|
|
|
|
|
You get the error using Server.GetLastError() .
|
|
|
|
|
Thank You Naveenth...
I got a result using Server.GetLastError()
Thank You very much
G. Satish
|
|
|
|