|
T is a generic type and where T : Control is a constraint. It means T can be of any type that derives from Control . When you write GetRenderedOutput(yourDiv); , compiler will infer the type from the type of yourDiv . Writing GetRenderedOutput<HtmlGenericControl>(yourDiv); is more explicit and it will only take a type of HtmlGenericControl .
|
|
|
|
|
Oh, so then you could write a method to say, format or parse strings, Dictonaries<>, Lists, ect and using a generic, pass the method anything and let it figure out what it is?
bool myMethod<T>(T Object) Where T : Object {}
I'm a self-taught programmer and I've read the whole way through Head First C# (which I really enjoyed and learned a lot), but I don't recall seeing anything about generics....Or if I did, obviously it didn't sink in. I'll have to go back and review that tonight.
Thank's again for all your help!
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|
|
can any one have similar method written in asp.net please reply
Thanking you
|
|
|
|
|
What is an web user control and when shud i go for an web user control?
What is the need of an user control?
|
|
|
|
|
Web user control are those controls which we create and add to Web pages. Creating a user control for Web Application is very similar to creating a user control in Windows Application. User controls in ASP.NET are based on the System.Web.UI.UserControl.
If you need to reuse the same composite page section in a number of times, you can go to create one ASP.net web user control. After that you can just add those modules to your page (one or more times) and get their functionality.
Web user control is very easy to make. You will have both designer to create the design. This is in contrast with Custom Controls, which is just a class and needed to override the Render method.
You will be creating a Web user control just like how you create a page. So, those are just custom page reusable modules.
|
|
|
|
|
Hi,
I am developing a project in .net and vb.net, offering free web hosting with subdomain,
like Geocities and Tripod.
but i dont know that how to create subdomain programmatically by vb.net coding.
As the user will fill the member forms and will become the member , he will get a url like
http://subdomain.domain.com automatically,
i have no idea about subdomain creation dynamically , got my point
We buy from webfusion that domain name. We have user name and password from this site. But we are creating all these things previously i told that using manually in this site. But what our requirement is need to create in programmatically. we have ip address host name, username and password.
if you have any idea about subdomain creation programmatically in any language or having any general idea help me
Thanx in advance
Every Successful Person Have A Painful Story
|
|
|
|
|
download DotNetNuke ... that is a subdomained manager all in VB.net with skins.
|
|
|
|
|
Dear All,
I want to create a new ASP.Net Ajax enabled website using Visual Studio 2005, But In the dialog New Web Site this template does not exists.
Where I can download this to my Visual Studio 2005 and If I am not downloading this template, then any one can guide me how can i add ajax controls as ScriptManager,UpdatePanel, etc to my ASP.Net Page.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
Try installing the ASP.NET AJAX server extensions. See here[^].
|
|
|
|
|
I have a label in my aspx page & iam changing its text via
document.getElementById("LabelID"). innerHTML = "SOmeText";
from JAVASCRIPT.
Now by default an ASP.NET label should retain its contents. But its not.
IS there any way to make it so I can change a label on the client-side and the contents persists back to the server?
If iam using a textbox it does works fine.
Proud To Be an Indian
|
|
|
|
|
I have not tried this. Just a wild guess. Try changing to innerText .
document.getElementById("LabelID").innerText = "SOmeText";
modified on Monday, September 28, 2009 10:15 AM
|
|
|
|
|
Navaneeth, I think the controls which don’t have the ‘name’ attribute wouldn’t maintain its contents on post back.
|
|
|
|
|
majee wrote: the controls which don’t have the ‘name’ attribute wouldn’t maintain its contents on post back.
For server controls, the id will be put as name. So what you are saying won't occur. The real issue here is a label render as HTML span and contents of span will not be posted to server. See my latest reply.
|
|
|
|
|
N a v a n e e t h wrote: For server controls, the id will be put as name. So what you are saying won't occur. The real issue here is a label render as HTML span and contents of span will not be posted to server. See my latest reply.
True 
|
|
|
|
|
AFAIK, there is no way to get the value on server which is changed by JS for a label. Label is rendered as HTML span and the values of HTML elements like this are not posted to server. If you know CSS, you can make a text box look like a label and change the text box value.
Please ignore my previous reply.
|
|
|
|
|
Use <asp:hiddenControl to change its value.
Anything other than input types are reflects its changes through javacript in server (Not even Serverside ReadOnly/Disabled TextBoxes). So even if you change the innerHTML of the control, you will not find it in server side. Rather use
document.getElementById("hiddeninput").value = "SOmeText";
document.getElementById("LabelID").innerHTML = "SomeText";
I hope this will help you.
|
|
|
|
|
Thanks Friends .. thanks a lot for you support
I implemented a textbox but since that textbox need not be Editable Can i change its style to that of a LABEL
Proud To Be an Indian
|
|
|
|
|
Of course budd.
Just add a Textbox . In the server side add:
txtbox.Attributes.Add("readonly", "readonly");
This will make the textbox readonly and also reflect any data being changed in the client.
If you make
txtbox.Readonly = true / txtbox.Enabled = false;
the textbox value changed in the client will not reflect in the server.
Hope you understand.
|
|
|
|
|
Hello,
I am looking for a web survey tool/framework (commercial or freeware, doesn't matter, but .NET for integration purposes) that allows to build web forms. Does anyone know one ?
Best wishes,
Desmond
|
|
|
|
|
Since I didn’t implement any third part web survey tool, I can’t suggest you a good one. But a quick search on google(Link) fetched dozens of links including commercial and free version. You please go through the links and choose one.
|
|
|
|
|
You can try the Survey™ Project at http://www.surveyproject.info . Survey is a free and open source web based survey and form engine toolkit for Microsoft's .net. written in asp.net and C#. It should match your needs.
|
|
|
|
|
i created a validator control was inherited "BaseValidator" and implemented "ICallbackEventHandler"
it's work well in normal page but generated problem when i create a MasterPage and use this control in
page that use MasterPage.
the error message is :
"The target 'ctl00_ContentPlaceHolder1_ExistFieldValidator1' for the callback could not be found or did not implement ICallbackEventHandler"
My vb code is:
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
<Assembly: WebResource("JScript.js", "application/x-javascript")>
Namespace Softcam
Public Class ExistFieldValidator
Inherits BaseValidator
Implements ICallbackEventHandler
Public Event ServerValidate As ServerValidateEventHandler
Dim _ControlToValidateValue As String
Protected Overrides Function EvaluateIsValid() As Boolean
Dim ctlToValidate As String = Me.GetControlValidationValue(Me.ControlToValidate)
Return ExecuteValidationValue(ctlToValidate)
End Function
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
Dim EventRef As String = Page.ClientScript.GetCallbackEventReference(Me, "", "", "")
If Me.EnableClientScript Then
Page.ClientScript.RegisterClientScriptResource(Me.GetType(), "JScript.js")
End If
MyBase.OnPreRender(e)
End Sub
Protected Overrides Sub RegisterValidatorDeclaration()
MyBase.RegisterValidatorDeclaration()
Me.Page.ClientScript.RegisterExpandoAttribute(Me.ClientID, "evaluationfunction", "FieldExistValidate")
End Sub
Protected Overrides Function DetermineRenderUplevel() As Boolean
Return Context.Request.Browser.SupportsCallback
End Function
Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult
Return ExecuteValidationValue(_ControlToValidateValue).ToString()
End Function
Public Sub RaiseCallbackEvent(ByVal eventArgument As String) Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
_ControlToValidateValue = eventArgument
End Sub
Private Function ExecuteValidationValue(ByVal ctlValidation As String) As Boolean
Dim args As New ServerValidateEventArgs(ctlValidation, Me.IsValid)
RaiseEvent ServerValidate(Me, args)
Return args.IsValid
End Function
End Class
End Namespace
And Javascript Code:
function
FieldExistValidate(val)
{
var
value = ValidatorGetValue(val.controltovalidate);
if
(ValidatorTrim(value).length == 0)
return
true
;
WebForm_DoCallback(val.id, value, AjaxValidatorResult, val, AjaxValidatorError, true
);
return
true
;
}
function
AjaxValidatorResult(returnValue,context)
{
if
(returnValue.toLowerCase() == 'true'
)
context.isvalid = true
;
else
context.isvalid = false
;
ValidatorUpdateDisplay(context);
}
function
AjaxValidatorError(message)
{
alert(message);
}
|
|
|
|
|
You please check the ClientID of that control on the master page. It may be different on master page and content pages.
|
|
|
|
|
Hi,
I want to make a function that will call automatically.
Suppose i have a registration form, at the registration time, a vouchar has een generated and that has a PIn number(ID). And it has 5 days validity.
I want to sent a mail, when the voucher is expired. I need to do this automatically.( When expire date comes, sent a mail with the inform of voucher hasbeen expired).
How can i do this with asp.net 2.0
Or any other idea.. plz let me knw in detail
Its urgent
Thabks & regards
|
|
|
|
|
Ha_80 wrote: How can i do this with asp.net 2.0
You can't.
Ha_80 wrote: Its urgent
Turns out that it's not urgent for anyone except you.
Ha_80 wrote: Or any other idea.
The best way to do this, is a windows service, because it can always run, check the DB, and send the emails.
Ha_80 wrote: plz let me knw in detail
This smells of 'I have taken a paid job and have no clue how to do it'. You're on your own, do some research, I've told you what to look up.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|