|
This method will be blocked by every single popup blocker out there....for very good reason. There is no (i repeat: NO) legitimate reason to want to hide a popup from a user.
|
|
|
|
|
Hi,
I have been getting the following error message whatever I tried to get rid of it, I couldn't succeed it. How can solve the problem? I tried to define the dropdownbox with (Dim myYearBox as New Dropdownlist) and it didn't work out too.
Error message is :"Object Referance not set to an instance of an object"
<br />
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
<br />
<br />
If Page.IsPostBack = False Then<br />
<br />
<br />
Dim myYearBox As DropDownList = CType(FormView1.FindControl("GetYear"), DropDownList) '<< ERROR<br />
<br />
myYearBox.Items.Insert(0, Now.Year.ToString)<br />
myYearBox.Items.Insert(1, (Now.Year + 1).ToString)<br />
<br />
<br />
'GetYear.Items.Insert(0, Now.Year.ToString)<br />
'GetYear.Items.Insert(1, (Now.Year + 1).ToString)<br />
<br />
Call populateDayFromBox(Now.Year, Now.Month)<br />
<br />
End If<br />
<br />
End Sub<br />
<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Make sure GetYear is spelt correct and is in the formview
How do you know which line is object reference?
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
It is spelled correctly and it is inside the formview. The error line was pointing the line where the line marked '<< Error'
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Hi,
Try to check FormView1.FindControl("GetYear") is returning null. To my experience FindControl in Asp.Net sometimes returns null even if the control is there. I think this is why you are getting this problem. Put a check on the code if its null then do something else.
Regards
|
|
|
|
|
Hi Jaffer,
The problem is dropdownboxes are not bind to any dataobjects. I was aimed to populate these boxes in runtime. However if I bind them to an objectdatasource, I am not able to define an event eg. (Dropdownbox_Clicked) because they are inside of th Formview control.
Therefore, I decided not to bind them and I don't use formview now. However now I am facing to another issue, How I am giong to assign their values as inputparameter to objectdatasource insert event below.
Here is the code sample. All I need to pass 5 doprdownboxes selectedvalue arguments to below procedure as inputparameters. When I click a button, these paramaters must be carried to following procedure.
<br />
Private Sub ObjectDataSource1_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles ObjectDataSource1.Inserting<br />
<br />
Dim ParamsFromPage As IDictionary = e.InputParameters<br />
<br />
Dim NewObj As New property_availability(0, 0, 0, 0, "")<br />
<br />
NewObj.Getyear = Int32.Parse(ParamsFromPage("GetYear")).ToString<br />
NewObj.GetMonth = Int32.Parse(ParamsFromPage("GetMonth")).ToString<br />
NewObj.GetDayFrom = Int32.Parse(ParamsFromPage("GetDayFrom")).ToString<br />
NewObj.GetDayTo = Int32.Parse(ParamsFromPage("GetDayTo")).ToString<br />
NewObj.GetStatus = ParamsFromPage("GetStatus").ToString<br />
<br />
ParamsFromPage.Clear()<br />
<br />
ParamsFromPage.Add("GetYear", NewObj.Getyear)<br />
ParamsFromPage.Add("GetMonth", NewObj.GetMonth)<br />
ParamsFromPage.Add("GetDayFrom", NewObj.GetDayFrom)<br />
ParamsFromPage.Add("GetDayTo", NewObj.GetDayTo)<br />
ParamsFromPage.Add("GetStatus", NewObj.GetStatus)<br />
<br />
End Sub<br />
<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Instead of using the object datasource to insert, why dont you call your busines object's insert method directly??
Alexei Rodriguez
|
|
|
|
|
I use Business object's insert method actually. Please see the code below. However I decided not use Formview because in runtime I must control dropdownboxes and their events. Now I am not able to pass the values of these boxes to below procedure because this boxes are not bind to objectdatasource anymore. I have to externally bind them somehow but I don't knwo how to do that.
<br />
Private Sub ObjectDataSource1_Inserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles ObjectDataSource1.Inserting<br />
<br />
Dim ParamsFromPage As IDictionary = e.InputParameters<br />
<br />
Dim NewObj As New property_availability(0, 0, 0, 0, "")<br />
<br />
NewObj.Getyear = Int32.Parse(ParamsFromPage("GetYear")).ToString<br />
NewObj.GetMonth = Int32.Parse(ParamsFromPage("GetMonth")).ToString<br />
NewObj.GetDayFrom = Int32.Parse(ParamsFromPage("GetDayFrom")).ToString<br />
NewObj.GetDayTo = Int32.Parse(ParamsFromPage("GetDayTo")).ToString<br />
NewObj.GetStatus = ParamsFromPage("GetStatus").ToString<br />
<br />
ParamsFromPage.Clear()<br />
<br />
ParamsFromPage.Add("GetYear", NewObj.Getyear)<br />
ParamsFromPage.Add("GetMonth", NewObj.GetMonth)<br />
ParamsFromPage.Add("GetDayFrom", NewObj.GetDayFrom)<br />
ParamsFromPage.Add("GetDayTo", NewObj.GetDayTo)<br />
ParamsFromPage.Add("GetStatus", NewObj.GetStatus)<br />
<br />
End Sub<br />
<br />
<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Unless im missing something, i dont see any sense on this previous code
You read the values from e.insertparameters into ParamsFromPage
Yo add ParamsFromPage into a temp object
You clear ParamsFromPage
You add them back to ParamsFromPage
???
What are you doing?
Alexei Rodriguez
|
|
|
|
|
Actually I have paased this paramaters to a class object if you carefully examine the code and then I pass the paramaters to insert function of objectdatasource object. In back and there is a kist object what keep the all the values.
Thanks Alex.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
NewObj.Getyear = Int32.Parse(ParamsFromPage("GetYear")).ToString
NewObj.GetMonth = Int32.Parse(ParamsFromPage("GetMonth")).ToString
NewObj.GetDayFrom = Int32.Parse(ParamsFromPage("GetDayFrom")).ToString
NewObj.GetDayTo = Int32.Parse(ParamsFromPage("GetDayTo")).ToString
NewObj.GetStatus = ParamsFromPage("GetStatus").ToString
ParamsFromPage.Clear()
ParamsFromPage.Add("GetYear", NewObj.Getyear)
ParamsFromPage.Add("GetMonth", NewObj.GetMonth)
ParamsFromPage.Add("GetDayFrom", NewObj.GetDayFrom)
ParamsFromPage.Add("GetDayTo", NewObj.GetDayTo)
ParamsFromPage.Add("GetStatus", NewObj.GetStatus)
What are you doing here??
paramsFromPage has the same values that i had in the beggining
By the way...
If carefully look at this:
NewObj.GetDayTo = Int32.Parse(ParamsFromPage("GetDayTo")).ToString
I think that getDayTo expects an int32, you are making extra conversions, you case the value to int32 and then to string with the tostring method and then the result is casted back to int32 when you assign it
Alexei Rodriguez
|
|
|
|
|
You are right Alex. I forgot to take it out actually. Thanks
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
Well, if you are 100% sure the name is correct (including the case) try executing the code at a later stage in the page's life cycle. Perhaps the control will not be null in page_preRender event.
I didn't get any requirements for the signature
|
|
|
|
|
Hello,
I'm newbie in ASP.NET and I want to develop a website using it but does my visitors need to install .Net Framework to visit my website?
Thanks
While (true) { Human.isLearnable = true; }
|
|
|
|
|
No, they just need a web browser, however the .NET framework is of course required on the server.
|
|
|
|
|
Oh, I feel better now
Thanks
While (true) { Human.isLearnable = true; }
|
|
|
|
|
|
its necessary to install .net frame work
|
|
|
|
|
bagla wrote: its necessary to install .net frame work
WOW !
|
|
|
|
|
Really?
You mean in Server-Side? Or in Client-Side?
I understood that .Net Framework should install in Server and I know why, but in Client?
Joking me, Right?
While (true) { Human.isLearnable = true; }
|
|
|
|
|
ignore the clueless answer you got here. I assure you that only the server requires the framework.
|
|
|
|
|
:-bd
While (true) { Human.isLearnable = true; }
|
|
|
|
|
What about Linux (or any other OSs) users? Can they visit my website?
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Anybody with a working web browser can visit your website.
|
|
|
|
|
Thank you a lot
While (true) { Human.isLearnable = true; }
|
|
|
|