|
|
you can design a base class to check the session is null or not, then all the pages you use to inherit the base class
|
|
|
|
|
I did that...
But what I need is not to allow the user to go back when back button is pressed...
Thanks
|
|
|
|
|
add following code in body tag
onload="history.forward(-1);"
|
|
|
|
|
I am using a datalist to easily display my data in 7 columns, but I can't seem to get the alignment correct. After a few tries i opened up the HTML and found border-collapse:collapse in the table's style. I used IE7s DevToolBar DOM viewer to remove it on the fly and everything looks and works great. So now my question is how do I get ASP.NET not to add it? I have tried using a CssClass, but the class option gets overwrote by the inline one. I also have tried to remove it after the fact with a little JavaScript (document.GetElementByID("elementID").style="" or document.GetElementByID("elementID").style.border-collapse="") both don't work. Thanks for any help.
|
|
|
|
|
Did you try the CellSpacing property?
Setting it to a positive value should remove the border-collapse style.
By the way, your javacript code is slightly wrong, try this:
document.getElementById("elementID").style.borderCollapse=""
But before doing such javascript stuff better try playing around with the border-related members of the DataList class.
Hope that helps
Klaus
|
|
|
|
|
Thanks, I've played with all the spacing and cell properties but none just remove the collapse (normally they added extra space I didn't want). Thanks for the javascript correction, I hate when javascript and CSS use different property names.
|
|
|
|
|
The exact effects of the ASP Class members to html output is poorly ducumented. Perhaps I'll find sth more exactly on google. I'll let you know.
Good Luck
Klaus
|
|
|
|
|
my windows dos not have IIS - (its not listed at Control Pannel/Add or Remove Programs/Add-Remove Windows Components/Windows Components Wizard list)
its Windows-Home edition service pack 2 -
can i install IIS from any where or i should shift to another windows? - if so,what version?
tx.
|
|
|
|
|
Running IIS on Windows Home Edition is not "officially" supported by Microsoft however it is possible to run it if you tweak some settings.
Please know however that tweaking these settings can severely cripple your machine so be prepared to reinstall your machine if anything goes wrong.
Check out this site for more info:
http://adamv.com/dev/articles/iis-on-xp-home[^]
If you don't want to get into messing around with registry files however, Windows Professional Edition is the version you'll want to get. It has IIS installed (which is the only way to run asp.net web sites on your local machine).
Good luck.
-Goalie35
|
|
|
|
|
This is not what you asked for, but perhaps the information you need...
If you are using Visual Studio 2005 you don't need IIS to test your web applications. It comes with a built in web server that is used when you start the application from Visual Studio.
---
Year happy = new Year(2007);
|
|
|
|
|
Hello folks,
I have a problem using ASP.NET 2.0 on IIS 6. I use a self made login routine using session variables. An object is stored in Session["user"] for this purpose. While on a test system everything works fine, on the real server the session variable disapears. This can happen within seconds or a few minutes while clicking around on the web site. Can't say anything more spcific. Does anyone know what can cause this problem?
Perhaps wrong server settings? If so, which?
Thx Klaus
|
|
|
|
|
|
Nope, definitely not. It's a proper server (Not just web hosting or something like that). Any Ideas nonetheless?
Why do you ask, did you experience similar problems?
One difference between test and productivity server exists. On the "real" server there is a http-auth based password check.
Thx for any help
Klaus
|
|
|
|
|
The reason I asked was that you have to change the StateServer with web farms.
|
|
|
|
|
Session variables does not disappear from a session by themselves. Write out the Session.SessionID value somewhere so that you can see if your session ends and you get a new one. If you don't get a new session, there is most likely something in your code that removes the session variables.
---
Year happy = new Year(2007);
|
|
|
|
|
4 All who may have the same problem in the future:
The problem is fixed!
The number of worker processes had been increased to 12 by our administrator. Resetting this value to 1 solves the problem.
Thx Klaus
|
|
|
|
|
Can someone please tell why the list box is not updating?
I have the following procedure to load my list box:
Protected Sub Load_Listbox()
'Purpose: Loads Listbox1 Control with the company titles from
' the AdeptMediaEmployees SQL Server DB
'Parameters: None
'Returns: Nothing
Dim dr As SqlDataReader
Dim cn As SqlConnection = New SqlConnection(MRMFunctions.WebConfigConnString)
Dim ID As String
Dim Title As String
cn.Open()
Try
Dim cd As SqlCommand = New SqlCommand("mrmsp_TitleList", cn)
cd.CommandType = Data.CommandType.StoredProcedure
cd.ExecuteNonQuery()
dr = cd.ExecuteReader
While (dr.Read)
ID = dr("TitleID")
Title = dr("Title")
ListBox1.Items.Add(New ListItem(dr("Title"), dr("TitleID")))
'ListBox1.Items.Add(New ListItem(Title, ID))
End While
Catch ex As Exception
If cn.State <> Data.ConnectionState.Open Then
Msg = "Could not open a connection to the SQL database."
lblErr.Visible = True
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = True
lblErr.Text = Msg
End If
Finally
dr.Close()
cn.Close()
End Try
End Sub
The procedure is called from the Page_Load event when the form is first opened.
The problem I have is when I make a change to the data listed in the list box. I call the same procedure from my update event:
Protected Sub btnUpdate_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles btnUpdate.Click
If (txtID.Text <> Nothing) And (txtTitle.Text <> Nothing) Then
lblErr.Visible = False
Dim bCont As Boolean = Update_Titles(CDec(txtID.Text), txtTitle.Text)
If Not bCont Then
Msg = "Update_Titles function failed."
lblErr.Visible = True
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = True
lblErr.Text = Msg
Else
lblErr.Visible = False
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = False
lblErr.Text = Nothing
Call Load_Listbox()
End If
Else
Msg = "Either the ID# or the Title box is empty. " & _
"Both boxes must be populated before I can " & _
"proceed with the update."
lblErr.Visible = True
lblErr.ForeColor = Drawing.Color.Red
lblErr.Font.Bold = True
lblErr.Text = Msg
End If
End Sub
I know the data is being updated, because I can see the updates in the SQL database. I also know the Load_Listbox procedure is being fired, because I stepped through the process and saw the update take place, but the listbox control was not updated.
Can anyone explain why?
Thank you,
Quecumber256
|
|
|
|
|
Hi
It is simple
Just refresh the page or after you add the fields write this:
response.redirect("the page itself")
Ok...
Love All
|
|
|
|
|
Have you placed a breakpoint in Update_Titles() to see if it's ever called? Why are you not simply databinding the listbox?
Instead of that extra code for missing params, try RequiredFieldalidators. It would eliminate 90% of that code.
You also may benefit from throwing exceptions instead of a boolean value.
try
lblErr.Visible = false;
Update_Titles(CDec(txtID.Text), txtTitle.Text);
Load_ListBox();
catch( ex as Exception)
lblErr.Visible = true;
finally
... whatever you want to do next.
|
|
|
|
|
Hey all,
I am having a major problem trying to pull up a word file that has been selected by the user using an HTML file input box (open file dialog box).
If I run it from my computer, the whole path is there when it tries to find the file selected.
If I run it on the webserver, it loses the path of the document.
Here is my code:
protected void openWord()
{
string pathname = File1.Value.ToString(); //HTML File Input Control
//set path of word doc you are opening
object fileName = pathname;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
//make word document appear
WordObj.Visible = true;
//open specified word document
Microsoft.Office.Interop.Word.Document wordDoc = WordObj.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
When I run this on my machine, its fine, the webserver has word installed on it.
Please help!
Thank you in advance!
Dave
|
|
|
|
|
sorry, Ill give you some output to clarify.
On my machine: C:\foldername\worddocumentselected.doc
On the webserver: worddocumentselected.doc
(path does not exist!)
Why am I losing the "C:\foldername\"?
Thanks Again!
Dave
|
|
|
|
|
many thanks guys
|
|
|
|
|
You need to show your designing skills to get feel like TABS....Use images and call different page on each click of tab.
Amit
|
|
|
|
|
Investigate how it works on known sites (Google, Yahoo ...)
|
|
|
|