View Complete Post
I have an objuct that I declared like this:
Class DailyStats Dim _day As String Dim _hour As String Dim _impressions As String Dim _clicks As String Property Day() As String Get Return _day End Get Set(ByVal value As String) _day = value End Set End Property Property Hour() As String Get Return _hour
What is the proper way to check for null or empty strings on dynamic objects? This is the only solution I've found so far:
if (admin.PasswordHash.GetType() == typeof(DBNull) || admin.PasswordHash == string.Empty)
If the field is null, the object returned is DBNull.Value, but if the field is empty string, it's return as a System.String object. This makes it impossible to do regular "admin.PasswordHash == DBNull.Value" check, as that will fail whenever the field has been set to empty string. Is my example the right (and only) way to go?
Hello, I am seeing a strange problem with Forms Authentication in my DD site. A user logs into and can view/edit/delete data all day, but when they execute a Custom Filter against data (for example , a control DynamicData/Filters/CustomerLastNameSearch.ascx ) then the site auth fails, and redirects to the log in screen.
in web.config I have
<authentication mode="Forms"> <forms name=".Star" loginUrl="~/Login.aspx" protection="All" defaultUrl="~/Default.aspx" path="/" timeout="43200" cookieless="UseCookies" /> </authentication>
Offhand, I am thinking two things : that DynamicData/Filters path requires some special handling for some reason, or the control extension ascx is causing auth to get confused. Has anyone else experienced this or have any suggestions? Thanks!
Is there any way or process to serialize the the objects?? i am trying to store the instance of few control in viewstate but it shows error msg that it is not a serialized object. should i perform some steps to serialize the objects ???
1 Partial Class _Default2 Inherits System.Web.UI.Page
3 Public Function Ohjoy(ByVal X As Integer) As Integer4 Dim theClass As New Class1 '= New Class1()5 theClass.ReSize(0)6 theClass.myBaby(0).GetName(0) = "Hello" 'Property Chars is read only'7 Return 18 End FunctionI have a first class named "Class1". I have a second class named "Class2" Class2, is a member of class 1,and is implemented as an array of objects of type Class 2.
If I try and call the Accessor GetName() my hard coded value "Hello" in my accessor is not returned? Onlyan alpha character like "T"
Also if I try and assigne a value using the setter GetName() it does not work, and the compiler gives me an error message "property Chars is ReadOnly? Does anyone know what is wrong in my code? Line 6 above
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Ohjoy(1)End SubEnd Class
Public Class Class1 Dim bs As Integer Public myBaby() As Class2 Public myB As Class2 Public Function ReSize(By