|
Hi,
Does IIS (Win XP version) support multithreading?
If so,how do we manage multithreading in IIS?
|
|
|
|
|
I want to stay with GridView (unless another view can easily for sorting and display in rows), but I want to make some rows bold depending on the contents of a field. I have an extra text field returned with my query that is null of "Bold" and I want the null rows to show normal and the bold rows to show as bold. Can this be done? How?
Thanks
|
|
|
|
|
To change the format of the gridview row, you can create a handler for the RowDataBound[^] event of the GridView control. In the handler, you can format the background color of the row based on data using the BackColor or the CssClass property of the GridViewRow instance (e.Row).
|
|
|
|
|
VS2k5
Win2k3
IIS6
.NET 2.0
In my ASP.NET 2.0 app I create and open an SQL connection in the page's constructor and call Dispose() in the destructor. The SQLConnection
object is a class member of the page. This page makes heavy use of the SQLConnection object so I felt opening and closing in the constructor/destructor respectively was good design. I know this doesn't take full advantage of connection pooling. Any design input would be very much appreciated.
Here's the destructor code:
/// Destructor
~Officer()
{
if( m_objConn != null )
m_objConn.Dispose(); // <-- Exception occurrs here.
}
/// End Destructor
When running this particular page through some testing I get the following exception in the destructor at the "m_objConn.Dispose();" line:
System.InvalidOperationException was unhandled
Message="Internal .Net Framework Data Provider error 1."
Source="System.Data"
StackTrace:
at System.Data.ProviderBase.DbConnectionInternal.PrePush(Object expectedOwner)
at System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject)
at System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Close()
at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at Officer.Finalize() in c:\sys\projects\AddOfficer.aspx.cs:line 46
1) Is this design good/bad?
1) Is this a bug?
2) Do I need a try/catch in a destructor? Is it good programming practice?
3) Why is this happening?
4) What is the meaning of life?
Any help is appreciated. TIA
|
|
|
|
|
Hi, I'm currently writing an application that has a collection of complaints (in an microsoft sql server database).
Now they want us to make it possible to upload files (mostly doc's and mails) and bind them to a complaint, so that later when another employee is browsing throught the complaints he can download/open files that belong to a certain complaint.
security is not an issue because it is an intranet application.
What we also thought of, was to store the files in the database (we're talking about a small app with few data) but I have no idea if that compromises performance or not.
As you can see we're quite new to all this, so any help is much appreciated, thx in advance.
|
|
|
|
|
|
You could, I suppose, handle the OnDayRender event and clear contents of cells you didn't want displayed. Something like this:
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(object o, EventArgs e)
{
}
void CustomDayRender(object o , DayRenderEventArgs e)
{
if (e.Day.Date >= System.DateTime.Today.AddDays(-3)
&& e.Day.Date <= System.DateTime.Today.AddDays(4))
{
e.Cell.BackColor = System.Drawing.Color.Honeydew;
}
else
{
e.Cell.Controls.Clear();
}
}
</script>
<html>
<head>
<title></title>
</head>
<body>
<form runat="server">
<asp:Calendar id="Calendar1" runat="server"
OnDayRender="CustomDayRender"
/>
</form>
</body>
</html>
|
|
|
|
|
HI,
I have read some papers and they tell that WSE 2.0 with WS-attachments does not encrypt the attachments ( they recommend using secure protocol like SSL to secure attachments). Now, WSE 3.0 replace WS-attachments with MTOM, I have found that MTOM is used for transmit large binary data, but I don't know whether we can encrypt it directly with WSE 3.0 or not.
If you have answer, plz tell me.
Thanks,
Hung
|
|
|
|
|
Is there any way to Hide "Create User" buttom?? I want to Hide this button when a value from a drop down is selected. That time i want to display Edit User Button!!
Thanks in Advance.
|
|
|
|
|
you can do it in two ways:
1. (preferably this) on client using javascript: add onchange attribute to dropdownlist and call a javascript function showHideButton like..
add attribute in code behind:
dropdownlist.attributes.add("onchange", "javascript:showHideButton(this.selectedIndex);")
javascript:
function showHideButton(index){
if(index > 0){ // i am assuming you have --NEW-- at zero index
document.getElementById("createuser").style.visibility = "hidden";
document.getElementById("createuser").style.display = "none";
document.getElementById("updateuser").style.visibility = "visible";
document.getElementById("updateuser").style.display = "block";
}
else {
document.getElementById("createuser").style.visibility = "visible";
document.getElementById("createuser").style.display = "block";
document.getElementById("updateuser").style.visibility = "hidden";
document.getElementById("updateuser").style.display = "none";
}
}
in the above case you have to create two buttons and hide one on loading of the page..
i suggest you to create only one button and change its text to Create User ot Update user on changing the value of list... on click event of button in code behind check its text and act accordingly..
2. on server side:
set autopostback=true for the dropdownlist.
then write a onselectedindexchanged handler in code behind and set visible=true or false for each button depending on selected index of the dropdownlist..
-----
|
|
|
|
|
I want to create an Access Database for my website...essentially like a guestbook example but with more data. Do I need Visual Studio to accomplish this or can I simply create script and ftp it to my server? BTW, I do have MX Studio...so I have Flash and Dream Weaver. Sorry about stupid question but I am new to this. Thanks,
Grousedog
|
|
|
|
|
You don't need Visual Studio, it's possible to write all code using any generic editor like Notepad, but Visual Studio contains a lot of stuff that makes it a lot easier.
You can download Visual Web Developer Express Edition[^] for free from Microsoft.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I'm writing a web service! Can you tell me how can I get my web service namespace from code.
For ex:
<webservice(namespace:="http: tempuri.org="" ")="">
...
Public Class Service
Inherits System.Web.Services.WebService
<webmethod>
Public Function HelloWorld() As String
Return "HelloWorld"
End Function
Public Sub GetWebServiceNameSpace()
'How can I get Web service Namespace
End Sub
End Class
Thanks,
Hung
-- modified at 12:01 Thursday 20th April, 2006
|
|
|
|
|
|
thanks minhpc_bk but I can't get namespace of own webservice
for ex:
|
|
|
|
|
Hung,
Below is a quick example:
Namespace myns
Public Class MyWebservice
Inherits System.Web.Services.WebService
Public Function getNameSpace() As String
'How can I get the namespace of this webservice (it's namespace is "myns"
getNameSpace = Me.GetType.Namespace
End Function
End Class
End Namespace
.....
Dim service As myns.MyWebservice = New myns.MyWebservice()
Dim nspace As String = service.getNameSpace
'The nspace object returns the "myns" value.
|
|
|
|
|
I create a web service (.asmx file) and I don't think I will make new object of my web service as your code:
Dim service As myns.MyWebservice = New myns.MyWebservice()
Dim nspace As String = service.getNameSpace
The VS Studio 2005 generate code like that:
<webservice(namespace:="http: tempuri.org="" ")="">
<webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)>
<global.microsoft.visualbasic.compilerservices.designergenerated()>
Public Class Service
Inherits System.Web.Services.WebService
Public Function getNameSpace() As String
Dim namespace as String = Me.GetType.Namespace
Response.Write(namespace) 'So I want to get namespace from here 'not until making new object.
End Function
End Class
End Namespace
And I want to get it's namespace without create new object.
Thanks,
Hung
|
|
|
|
|
r u want to use webservice in your application ????????
jitendra
|
|
|
|
|
I create a web service and put it on server. The web service itselft will get it's namespace and respond for client.
have you got any ideas?
Hung
|
|
|
|
|
but i need to show users in a list box too...(withput flashing the page )..urgently..the chat is part of my graduation project..plz help ..thanks for every one can help....bye
|
|
|
|
|
Hi All... Currently i am doing my banking application using ASP.Net,C#, SQL Server2000... i want some technical solution realated securities from you guys as follow..
i already logged to my application by using username and password.. after login page my home page Home.aspx coming on screen.. i have features all like Balance Inquiry, Mini Statement, Last Transaction, Private Banking, Net Banking in my Home Page in left menu side. All Features are working very well.. For Security Reason i want some technical help from all of you guys...
Problem is After my successful login page If i not touch the Home page or if i not click on any features available in home page for 10 minutes.. Like if i click on Balance Inquiry Link after 10 minutes that time Page Login.aspx want to open instead of BalanceInquiry.aspx... After my successful login by username and password i want to open page BalanceInquiry.aspx (do not want open Home.aspx Page Again)... For that what i have to do in my Application to make more secure... if u have any articles link then please send me..
Please Please Help me if you people have some technical solution... Bcz right now i am on mid way of that project... if u have any articles or articles link please help me out....
Regards,
Patel...
|
|
|
|
|
follow the teps:
1. set the session.timeout = 10 in code or in web.config
2. after login store anything in session that is unique for everyuser (probably username). In pageload of everypage check if that value still exists in session if not redirect to login page and force the session to expire using session.abandon or session.removeall you may also delete the cooki for the session.
3. use http_referer to redirect to the same page after login again (balance sheet or so..) check if referer is nothing then redirect to home page otherwise redirect to referer..
you can even give warning before expiry of session using javascript settimeout ..
-----
|
|
|
|
|
hi all,
On one page of the application validators are not getting fired.
can please any one give me clue what could be the reason?
neoms21
|
|
|
|
|
From your message it is not clear that which validation control are you using. Anyway, please make sure that you have enabled the validation control by using Enabled property. Apart from that check whether you have enabled client side validation for that page. If yes, give appropriate error message so that you will get notified.
Hope this will help you
Thanks
Rakheesh
|
|
|
|
|
i have already checked for all things mentioned. but the thing is that requiredfieldvalidators are getting fired on the development server when i deploy the application on LIVE environment validators dont work only on one page of the application. Rest are working fine.
looking for your advice.
Manoj
|
|
|
|