|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
只要你想学,就没什么优缺点,上面那位大哥已经把网上的评论说了,但我认为想学哪个都一样,不然它就不可能在当今时代数字艺术方面存活到今天控件|前提自界说控件要激发LoadPostData办法,必要包括一个ID为this.UniqueID的控件
可在控件组中到场一个Hidden控件!
writer.Write("<inputtype=hiddenname="+me.UniqueID+">")
大概爽性更复杂的做法,把submit的name属性设置为me.UniqueID
ImportsSystem.ComponentModel
ImportsSystem.Web.UI
ImportsSystem.Web.UI.WebControls
<DefaultProperty("Text"),ToolboxData("<{0}:Loginrunat=server></{0}:Login>")>PublicClassLogin
InheritsSystem.Web.UI.WebControls.WebControl
ImplementsIPostBackDataHandler
PublicEventCheckErrorAsEventHandler
Private_userAsString
Private_passAsString
PublicFunctionLoadPostData(ByValpostDataKeyAsString,ByValpostCollectionAsSystem.Collections.Specialized.NameValueCollection)AsBooleanImplementsSystem.Web.UI.IPostBackDataHandler.LoadPostData
_user=CType(postCollection(Me.UniqueID&":User"),String)
_pass=CType(postCollection(Me.UniqueID&":Pass"),String)
If_user_passThen
ReturnTrue
Else
ReturnFalse
EndIf
EndFunction
PublicSubRaisePostDataChangedEvent()ImplementsSystem.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent
OnCheckError()
EndSub
PublicSubOnCheckError()
RaiseEventCheckError(Me,NewSystem.EventArgs())
EndSub
ProtectedOverridesSubRender(ByValwriterAsSystem.Web.UI.HtmlTextWriter)
writer.RenderBeginTag(HtmlTextWriterTag.Table)
writer.RenderBeginTag(HtmlTextWriterTag.Tr)
writer.RenderBeginTag(HtmlTextWriterTag.Td)
writer.Write("用户名:")
writer.RenderEndTag()
writer.RenderBeginTag(HtmlTextWriterTag.Td)
writer.AddAttribute(HtmlTextWriterAttribute.Type,"TextBox")
writer.AddAttribute(HtmlTextWriterAttribute.Name,Me.UniqueID&":User")
writer.AddAttribute(HtmlTextWriterAttribute.Maxlength,"30")
writer.RenderBeginTag(HtmlTextWriterTag.Input)
writer.RenderEndTag()
writer.RenderEndTag()
writer.RenderEndTag()
writer.RenderBeginTag(HtmlTextWriterTag.Tr)
writer.RenderBeginTag(HtmlTextWriterTag.Td)
writer.Write("暗码:")
writer.RenderEndTag()
writer.RenderBeginTag(HtmlTextWriterTag.Td)
writer.AddAttribute(HtmlTextWriterAttribute.Type,"Password")
writer.AddAttribute(HtmlTextWriterAttribute.Name,Me.UniqueID&":Pass")
writer.AddAttribute(HtmlTextWriterAttribute.Maxlength,"30")
writer.RenderBeginTag(HtmlTextWriterTag.Input)
writer.RenderEndTag()
writer.RenderEndTag()
writer.RenderEndTag()
writer.RenderBeginTag(HtmlTextWriterTag.Tr)
writer.AddAttribute(HtmlTextWriterAttribute.Cols,"2")
writer.RenderBeginTag(HtmlTextWriterTag.Td)
writer.AddAttribute(HtmlTextWriterAttribute.Type,"Submit")
writer.AddAttribute(HtmlTextWriterAttribute.Name,Me.UniqueID)
writer.AddAttribute(HtmlTextWriterAttribute.Value,"提交")
writer.RenderBeginTag(HtmlTextWriterTag.Input)
writer.RenderEndTag()
writer.RenderEndTag()
writer.RenderEndTag()
writer.RenderEndTag()
EndSub
EndClass
</p>问题是他们究竟是喜欢他们是使用软件时,速度快还是速度慢好.(当然在3秒以内).无论是他们输入资料时,查找资料时,分析资料时. |
|