|
do u have session expiry knowledge...
i struct in same question of aman saroya.. (3-4 post below ur..)
|
|
|
|
|
Hi
Its workign fine if i have to search for 1 field, If i have to search for
2 fields it fails. How can i handle it...
Suppose, user enter a card number and wrong name corresponding to those card numbers. If use AND operator in my query, it will still return records.
My gridview is using template, for null records.
If the user is making wrong query, i want no records to returned...
Can you help me with this.
Inderjeet Kaur
Sr. Software Engg
modified on Thursday, August 20, 2009 1:10 AM
|
|
|
|
|
Will anyone help me out from this basic doubt? Why there are two types of controls? I got the way of coding with html controls:- n all while using html controls but why why why...if we are having standard controls.....when u double click them u r directly on aspx.cs page for coding then when to go for html and when for standard controls?
|
|
|
|
|
Here is what MSDN says about HTML controls.
By default, HTML elements within an ASP.NET file are treated as literal text and are programmatically inaccessible to page developers. To make these elements programmatically accessible, you can indicate that an HTML element should be parsed and treated as a server control by adding a runat="server" attribute.
Rohit Kulkarni wrote: if we are having standard controls.....when u double click them u r directly on aspx.cs page for coding then when to go for html and when for standard controls?
Use ASP.NET server controls always possible. Use the HTML controls with runat=server when it is absolutely necessary.
When ASP.NET server controls are used, you have very less control over how it is rendered. On the other hand, HTML controls marked with runat=server is just a mapping to the equivalent control class. For example, <input id="someid" type="text" runat="server" /> maps directly to HtmlInputText control. Designers tend to use this type because they know exactly how it is rendered.
Though I haven't used, it looks like the introduction of CSS control adapter[^] will help to control the rendering.
|
|
|
|
|
I want to check a datetime value saved in db...and only accept those values which are just lagging 5 seconds with current datetime value....i tried with compare and subtract but not getting the point....
<code>
string dt = DateTime.Now.ToShortDateString(); \\current datetime value.
DateTime dt1 = Convert.ToDateTime(dt);
string dtime = dr1[0].ToString(); \\datetime value from database.
DateTime ddt = new DateTime();
ddt = Convert.ToDateTime(dtime);
</code>
in my next step i want to check whether ddt value lags 5 or less seconds than dt1(which is current datetime value of system) then save those values to an string array.....
|
|
|
|
|
Use Subtract method in the DateTime class.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
i did but im not quite sure with timespan values that im getting....
what i did
timespan ts = dt1subtract[ddt];
now after this how to put condition of 5sec on timespan value....
|
|
|
|
|
Perhaps if you had any idea what you were doing, you'd put a . after the timespan and notice that amongst it's properties is one that gives you the time in seconds.
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.
|
|
|
|
|
Im not getting it...can u please write code for timespan value for subtracting 5...
|
|
|
|
|
try this..
DateTime dt1 = database_date;
DateTime dt2 = DateTime.Now;
TimeSpan t2 = dt1 - dt2;
if((t2.Seconds)<=0)//according to ur condition...
{}
thnx & regards,
Gurinder Singh
Web Developer
|
|
|
|
|
i read the previous posts about session expiration.
However i m not able to get or understand solution about my problem.
scenario is :
I have a web application of enter purchase bill.
and some search lists and validations are also there in the form.
now when end user is trying to enter 10-15 items in the forms
session expiration error is occured.
or "object reference not set to an instance of object " ( as i use session variable like cart system to update grid with datatable).
Now i want that either session should not expire for long period of time
or
if session expired then if same user login again and open the same form again it will automatically asked for copy session expired items.. somethng like that....( bt the problem is sessionid will b change next time.. and database is required for this.. )
looking forward for quick reply..
|
|
|
|
|
you can give the session expiration period in web.config file...
code:
< sessionState timeout="120">
|
|
|
|
|
thnx for ur quick reply...
I used it.. but no effect..
and i hv one more doubt.
session should not expire until we r working continuously.
bt still my session is expire.. is it possible..???
|
|
|
|
|
Hi Try increasing the Session Timeout. If still you want to save the data, save it in database and populate when next time user login.
Other problem (Object refrence not set to an intance of an object) can be a casting problem...
Inderjeet Kaur
Sr. Software Engg
|
|
|
|
|
Hi friends,
how can i download a wav file on clicking a HTML Download Link?...
Note: without zipping that file
Thanks in advance
|
|
|
|
|
Hi Guys
I am working an asp.net application in which i required to fetch client PC MAC address
I gone through this Script but its giving Error
So Any Other solution Plz Tell me
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title>
<script id="clientEventHandlersJS" type="text/javascript">
function Button1_onclick() {
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
var service = locator.ConnectServer(".");
var properties = service.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration");
var e = new Enumerator (properties);
document.write("<table border=1>");
dispHeading();
for (;!e.atEnd();e.moveNext ())
{
var p = e.item ();
document.write("<tr>");
document.write("<td>" + p.Caption + "</td>");
document.write("<td>" + p.IPFilterSecurityEnabled + "</td>");
document.write("<td>" + p.IPPortSecurityEnabled + "</td>");
document.write("<td>" + p.IPXAddress + "</td>");
document.write("<td>" + p.IPXEnabled + "</td>");
document.write("<td>" + p.IPXNetworkNumber + "</td>");
document.write("<td>" + p.MACAddress + "</td>");
document.write("<td>" + p.WINSPrimaryServer + "</td>");
document.write("<td>" + p.WINSSecondaryServer + "</td>");
document.write("</tr>");
}
document.write("</table>");
}
function dispHeading()
{
document.write("<thead>");
document.write("<td>Caption</td>");
document.write("<td>IPFilterSecurityEnabled</td>");
document.write("<td>IPPortSecurityEnabled</td>");
document.write("<td>IPXAddress</td>");
document.write("<td>IPXEnabled</td>");
document.write("<td>IPXNetworkNumber</td>");
document.write("<td>MACAddress</td>");
document.write("<td>WINSPrimaryServer</td>");
document.write("<td>WINSSecondaryServer</td>");
document.write("</thead>");
}
</script>
</head>
<body onload ="Button1_onclick();" >
</body>
</html>
Thanks In Advanced
krishna veer singh
|
|
|
|
|
What does 'it's giving error' mean ? That's kind of useless.
As you're finding, you can only find the Mac address in IE, no other browser, and then only via an ActiveX control.
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.
|
|
|
|
|
Ya Its working only in ie 6.0 after Active ActiveX component
but I want Script which work in all browser
or
Any different method i can use
krishna veer singh
|
|
|
|
|
krishnaveer wrote: Any different method i can use
No other alternatives.
|
|
|
|
|
So How can go ahead with this one
becoz its my application requirement
krishna veer singh
|
|
|
|
|
You customer may not know about web applications. But as a programmer, you should be able to understand the limitations of a web application and take appropriate design decisions. As I said, there is no way to get clients MAC id. Try to make your customer understand this and think about other possible designs.
BTW, what are you doing with the clients MAC id?
|
|
|
|
|
If your client had approached a real programmer, then they would have dealt with someone who told them what was physically possible, instead of someone who accepted anything that they could imagine, despite having no idea how it could be done.
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.
|
|
|
|
|
sorry buddys it might be in wrong category, but i use ASP.NET platform
for devloping so...
now my question:
i have table formated as three column:
id,parent_id,name
ex..
id /parent_id /name
1 /null /ABC1
2 /1 /ABC2
3 /1 /ABC3
4 /2 /ABC4
5 /4 /ABC5
6 /3 /ABC6
for example i wnt to retrive perticulars child and sub child of id 2 then
it should give result:
2 /1 /ABC2
4 /2 /ABC4
5 /4 /ABC5
actually i want perticulars child and sub childs.. if id is 2 den i want child of id 2, and sub childs of id 2,s child and so on..
Please giv me appropriate query for it...
thanks in advance
modified on Wednesday, August 19, 2009 2:58 AM
|
|
|
|
|
Can you expl more because what you asking and what your result is doesnt make sence.
|
|
|
|
|
actually i want perticulars child and sub childs.. if id is 2 den i want child of id 2, and sub childs of id 2,s child and so on..
|
|
|
|