|
Hi,
How to disable a specific item present in a dropdownlist!
For example i have a dropdown list with following values:
india
australia
america
now, in the dropdownlist 'india' should be visible but the user should not be provided with a provision to select it!!!!
Gautham
|
|
|
|
|
Well you can always add a Javascript to alert the user of wrong selection and reset it.
Mubashir
Software Architect
Storan Technologies Inc, USA
Every job is a self portrait of the person who did it.
|
|
|
|
|
hi all ,
problem as follows ,
i am using method called
public void ExecuteNonQuery(string sql) inside Database Class .functionality of this method is takes the sql query and execute by using sqlcommand class here each method for example AddSubscriber() method is for inserting values into Subscriber table and AddSubscriberLogin() this is for inserting values into Subscribelogin Table and we have a link table called Subscribrsubscribelogin()
wihich containes both Subscriber and Suscriberlogin Id's so Due to Some problem like internet the values are not stored into SubscriberSubscriberlogintable so clint canot see all logins of Subscribers i got an idea of using sqltransactions i used as follows
Code:
in subscriber class
class Subscriber
{
AddSubscriber()
{
string sql="";//insert query
ExecuteNonQuery(sql);
}
but this code is not working. i need like to add All methods like AddSubscribeLogin() And AddSubscriSubscribeLogin() After that only i have to Commit other wise rollback all table values.
}
public void ExecuteNonQuery(string sql)
{
SqlConnection connection = new SqlConnection(databaseConnection);
try
{
connection.Open();
transaction=connection.BeginTransaction();
SqlCommand command = new SqlCommand(sql, connection);
command.Transaction=transaction;
command.ExecuteNonQuery();
transaction.Commit();
}
catch(Exception ex)
{
transaction.Rollback();
}
finally
{
connection.Close();
}
}
but when i am calling in each method it is commit always can u suggest any solution please .
Thanks And Regards,
Kinnu
-- modified at 6:51 Thursday 3rd May, 2007
|
|
|
|
|
I am getting problem in doing data modifications(insert,update,delete) in my CUSTOM DATABASE that i have created instead of using the default(i.e ASPNETDB.MDF that gets created by aspnetsqldataprovider by asp.net which also provides different asp.net services such as membership,role,profiles etc)
what exactly i must do?
also i want to know the way one can change default provider in asp.net 2.0 for different services.
m.h.adhia
|
|
|
|
|
There's this file that I wanna open from my web application, but I want it to open by Google Earth, the file is not located on the server it's on the user's computer but the application knows its name and path: "C:\\Places.kml"
How can I do that? I'm using ASP.NET web application in C#
|
|
|
|
|
You can't open files on the users computer. You have have the user upload the file to the web server and then you can open it.
Ben
|
|
|
|
|
Can I know if there is any testing tool to test the dotnet applications?
|
|
|
|
|
Being a developer you should test ur application with unit testing only.
there are lot of tools available to test the application that will be carried out by the testing or QA dept.
Regards,
Satips.
|
|
|
|
|
Remind me not to hire a developer that only tests his theapplication with unit tests, or rather one that broadly asserts developers should only use unit tests. I would recommend other people also avoiding such appointments.
|
|
|
|
|
In what way you want to test your application there N number of tool available in the market ...
Do you want to see the performance, Code review, etc of your application
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
I want to see performance and Code review also
|
|
|
|
|
Try to use ANTS Load or Microsoft Applcation Center Test which comes along with VS.
|
|
|
|
|
If you want to unit test your code than, NUnit is the best free testing tool available. You can get it from www.nunit.org
|
|
|
|
|
I am using Session in a web page before page load. i.e., I have a global variable which instantiates a class where current.session is used.
My current.session is nothing when I create the object for the class.
But after the Page loads, session shows all values.
Please help..
Senthil
|
|
|
|
|
Unless you set up the global variable in the session in the global.asax session.Start event you won't exist until the first page load. Unless I am missing something here?
Ben
|
|
|
|
|
Hi
in page_load im calling a function that retrieve data from the database
<small>private void getLocationStdHours()<br />
{<br />
string cacheKey = "stdHoursDS";
LocationsBL Loc = new LocationsBL();<br />
DataSet ds=Loc.GetLocationStdHours(vLocCode);<br />
<br />
Cache.Insert(cacheKey,ds,null,DateTime.Now.AddHours(1), TimeSpan.Zero);<br />
dgLocStdHours.CurrentPageIndex=0;<br />
dgLocStdHours.DataSource=((DataSet)Cache["stdHoursDS"]).Tables[0];<br />
dgLocStdHours.DataKeyField="rownum";<br />
Response.Write("before : "+((DataSet)Cache["stdHoursDS"]).Tables[0].Rows.Count);<br />
dgLocStdHours.DataBind(); <br />
<br />
btnNew.Disabled = false;<br />
}</small>
the data shows fine without problems
but when i click the "New Record" button which is a server control
private void btnNew_ServerClick(object sender, System.EventArgs e)<br />
{<br />
DataSet ds = Cache["stdHoursDS"] as DataSet;<br />
<br />
if(ds == null)<br />
{<br />
Response.Write("Session timeout - please reload page");<br />
return;<br />
}<br />
.....
the Cache["stdHoursDS"] is null now !!!
but not always in some cases it works sometimes not ?
what is the problem here ?
Note : this problem just appear when i connect from outside the local lan
using VPN or the intranet . its work prfectly from my PC or other PCs in the same lan
thanks
-- modified at 4:43 Thursday 3rd May, 2007
|
|
|
|
|
Normally the only reason why something would be kicked out of the cache before the expiration time is because the web site needed more memory so it would expire the cache before its time. NOTE you are using an absolute expire, so it will for sure expire in 1 hour. So I guess that is a possibility as well. You should write some code checking to see if the object exists in the cache before you try to use it. If it isn't there you will need to add it again.
If you didn't mean to force an expire of the dataset in 1hour then you should use the sliding expiriation. Then it will only expire if it hasn't be used for a certain period of time.
Hope that helps.
Ben
|
|
|
|
|
the problem is not appearing while i run the application in the local network !
i face the problem when i run the form throug VPN or remote connection which is slower .
i am not loosing the data after a long time i am loosing it immediately after a postback which
takes less than 2 seconeds and this happening sometimes from the first postback sometimes after 10 postbacks.
for now what i did is checking if the Dataset in the cache is still exists or not if not i am generating it again which means loosing the not saved changes .
but i want if there is an IIS configurations that could affect the cache ?
many thanks.
|
|
|
|
|
IIS controls a couple of things. In the app pool there is a recycle app pool that would re-set your entire web application, this includes the cache. By default this re-set happens like every 27 hours or something weird like that. Normally, I change it to recycle real early in the morning like 3am. The web site it self has many timeout settings for the session. I don't see any reason why a session expiring would affect the cache. I guess the question is how much data are you putting into web server memory when the post back occurs. If you are putting huge amounts of data into you web server memory then the cache could be cleared early because the server is running out of memory.
Hope that helps.
Ben
|
|
|
|
|
|
hmm, you want a menu? Look for some easy javascript
This is an simple example, its not working super but i hope i can make my point with this!
<code>
<html>
<head>
<style type="text/css">
#MenuItem{
width:150px;
border-style:solid;
height:25;
}
#subMenuItem{
width:150px;
visibility:hidden;
border-style:solid;
}
</style>
<script type="text/javascript">
function openMenu(objID)
{
document.getElementById(objID).style.visibility = 'visible';
}
function closeMenu(objID)
{
document.getElementById(objID).style.visibility = 'hidden';
}
</script>
</head>
<body>
<div id="MenuItem" onMouseOver="openMenu('SubMenuItem')">My Links</div>
<div id="SubMenuItem" onMouseOut="closeMenu('SubMenuItem')">
<lu>
<li>Link item</li>
<li>Link item</li>
<li>Link item</li>
<li>Link item</li>
</lu>
</div>
</body>
</html>
</code>
Stef
|
|
|
|
|
I am doing a project where I have to search Client on the Database so I want to search from the table where Client will Show on the data.
Romeo
|
|
|
|
|
What you did so for this application? What error it shows?
Regards,
Satips.
|
|
|
|
|
OK you want to say that your client data is in Database and you need to show that ?
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
What is SVG and its purpose? How can we use it? When will we go to SVG?
|
|
|
|