|
Member 3015509 wrote: The sessions are losing is postback and in other cases. But only IIS 5.1, in the asp.net 2.0 it dosoen't ocurr.
This is not clear. Please explain it more. Also some sample code would be helpful
|
|
|
|
|
ah i was wrong didnt realise it works in 5 sorry!
|
|
|
|
|
|
I'm Sure,
When select item in listbox1, session is losed!!
Why is ocurring?? Is needin some configuration in IIS or asp.net 2.0?
Thanks,
|
|
|
|
|
Ok,
Let's go...
Code:
the first moment, this code is called in load method
****************************************
dim ds as dataset
ds = obj.list ' the method return a dataset of products
listbox1.DataSource = ds
listbox1.DataTextField = "Name"
listbox1.DataValueField = "ID"
listbox1.DataBind()
Session("ds") = ds
****************************************
the second moment, this code is called in detail method, when select a item in listbox1
****************************************
ds = Session("ds")
Dim dr() As DataRow = ds.Tables(0).Select("ID = " & listbox1.SelectedValue)
txtName.Text = dr(0)("Name")
txtDescript.Text = dr(0)("Descript")
lblNameSystem.Text = dr(0)("NameSystem")
****************************************
The Error:
Object not istance.
I identified that error is ocurring in Session("ds"), but is ocurring only IIS 5.1., in debug it isn't ocurrign.
Did you understand me?
Thanks,
|
|
|
|
|
Ok,
Let's go...
Code:
the first moment, this code is called in load method
****************************************
dim ds as dataset
ds = obj.list ' the method return a dataset of products
listbox1.DataSource = ds
listbox1.DataTextField = "Name"
listbox1.DataValueField = "ID"
listbox1.DataBind()
Session("ds") = ds
****************************************
the second moment, this code is called in detail method, when select a item in listbox1
****************************************
ds = Session("ds")
Dim dr() As DataRow = ds.Tables(0).Select("ID = " & listbox1.SelectedValue)
txtName.Text = dr(0)("Name")
txtDescript.Text = dr(0)("Descript")
lblNameSystem.Text = dr(0)("NameSystem")
****************************************
The Error:
Object not istance.
I identified that error is ocurring in Session("ds"), but is ocurring only IIS 5.1., in debug it isn't ocurrign.
Did you understand me?
Thanks,
|
|
|
|
|
Leandrão wrote: dim ds as dataset
Leandrão wrote: Object not istance.
I guess you haven't declared the dataset again in the event. Or you may consider declaring it outside the pageload. Also the page_load code should be put inside If not isPostBack block, else the dataset will be created and filled to session each time page posts back.
|
|
|
|
|
I hope casting required when assin session dataset to local object dataset.
I just modified your code as follows
the second moment, this code is called in detail method, when select a item in listbox1
****************************************
ds = DirectCast(Session("ds"), Dataset)
Dim dr() As DataRow = ds.Tables(0).Select("ID = " & listbox1.SelectedValue)
txtName.Text = dr(0)("Name")
txtDescript.Text = dr(0)("Descript")
lblNameSystem.Text = dr(0)("NameSystem")
****************************************
smile
|
|
|
|
|
Ok,
I'm going to see it.
Thanks
|
|
|
|
|
Hi,
The problem is continuing!!!
I don't know like solve it.
Thanks,
|
|
|
|
|
can you provide at what level(i.e line) the error is getting and what error. In c# it is compilation error if we don't cast session dataset.
smile
|
|
|
|
|
I created a new page and used simple code testing session with string ("its my text"). The error ocurred. I'm thinking to myself that this error is in IIS!! Because it isn't ocurring in deployment!!!
|
|
|
|
|
Leandrão wrote: . I'm thinking to myself that this error is in IIS!!
Unlikely. While it must be tempting for you to think that your code is better than Microsoft's, it's probably pretty unlikely. I would suspect that your problem has more to do with you using the wrong SessionState type or just assigning it in the wrong place.
|
|
|
|
|
Hi Pete,
I've already discovered the error.
The error was caused because name resolution in domain.
My code was correct and IIS too, but the network's configuration was wrong.
Thanks my friend!!!
|
|
|
|
|
Hello all,
I'm designing menu for onlineshopping site.
i want to design a menu that open right to left not left to right.
how do i can design menu that it's submenus flow right to left?
my menu is on the right of my web page.
Thank you,
Hoda
modified on Thursday, April 3, 2008 9:02 AM
|
|
|
|
|
There is a really cool website on the internet called Google, awh forget it just click on this: menu+right+to+left[^]
|
|
|
|
|
Hi all,
I need help,I am entering datetime in dd-mm-yyyy format by TextBox1.Text but i need only "mm" is to enter and retrive from sqlserver database.
How it possible?
In Vb.net month(colname)='"&month(TextBopx1.Text)"'
dhanu
|
|
|
|
|
You could try and seperate the date format out by using split function, not sure though
|
|
|
|
|
The text property of your textbox is a string type. You cannot get the month only from a string using a month() function. You can split the string on the '-' character and the retrieve the month from the string array..
<br />
Dim sDateParts as String() = TextBox1.Text.Split('-')<br />
Dim sMonth as String = String.Empty<br />
<br />
if (sDateParts.Length = 3)<br />
sMonth = sDateParts(1)<br />
|
|
|
|
|
You could always use DateTime.Parse(TextBox1.Text).Month; . I know it's C#, but you can translate this to VB.NET yourself - it's not that hard.
|
|
|
|
|
Hi,
Sir,
1)When pass javascript function in my server side custom control
then he give me error 'Object Expected' but my function
already exits in my javascript file. ?
2)When pass javascript function in my server side custom control
then he give me error 'Undefied' but my textbox or control alrady
already exits in my javascript file. ?
Please send solution
Thanks & Regards
lav naphade
lav naphade
|
|
|
|
|
can you post your code please
|
|
|
|
|
have u just checked the HTML code(after execution) of the page where you've put that control?
check that the names are same as the name used to get control by javascript....
if possible then provide code..
Ashish Sehajpal
|
|
|
|
|
Make sure any syntax errors on your javascript function and double check the control client Id's in view source.
smile
|
|
|
|
|
Hii Everybody
See I have 10 pages in report,the total is calculated on end of each page and grand total is calculated on end page.
Now i want with grand total it also show Total of all previous pages like on end page means 10th page ,it shows
Total of 1st Page -- 100
Total of 2nd Page -- 120
Total of 3rd Page -- 50
Total of 4th Page -- 40
|
|
Total of 10th Page--60
----------------------------------
Grand Total ----- 370
--------------------------------------
Hope u understand my problem.Please send me solution as early as possible.
Waiting 4 ur reply
Manpreet Sadana
|
|
|
|