|
Hello,
I started to work with Atlas and I use the Sys.UI.AutoCompleteBehavior.
I need to extend it and to override one of its methods.
I will appricaite if someone will tell me how to do it.
What I did is:
1 - I created a .js file with:
Type.registerNamespace('My.Sys.UI');
My.Sys.UI.MyAutoCompleteBehavior = function () {
My.Sys.UI.MyAutoCompleteBehavior.initialize(this);
}
this.initialize = function() {
My.Sys.UI.MyAutoCompleteBehavior.callBaseMethod(this,'initialize');
}
this.dispose = function() {
My.Sys.UI.MyAutoCompleteBehavior.callBaseMethod(this,'dispose');
}
My.Sys.UI.MyAutoCompleteBehavior.registerSealedClass('My.Sys.UI.MyAutoCompleteBehavior',Sys.UI.AutoCompleteBehavior);
Sys.TypeDescriptor.addType('script','MyAutoCompleteBehavior', My.Sys.UI.MyAutoCompleteBehavior);
and then instead of using:
<behaviors>
<autoComplete
.....
...../>
<behaviors>
I used:
<behaviors>
<autoComplete
.....
...../>
<behaviors>
-- modified at 19:13 Friday 30th June, 2006
|
|
|
|
|
Seems you didn't say what you might want to extend, or what happens with your sample code.
|
|
|
|
|
Sorry,
I want to extend the _setText method (I didn't put it in my code yet)
and I get Object doesn't support this property.
|
|
|
|
|
Hi all
I am trying to calculate longitude & latitude radius GPS distance calculation
The formula is
-------------------
a = sin(lat1) * sin(lat2)
b = cos(lat1) * cos(lat2) * cos(lon2 - lon1)
c = acos(a + b)
d = R * c
How can i write this formula in asp.net (using VB)
HELP ME
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
|
Hi Everyone,
I have built a control which is a special calendar object. You can click once on a start date, then once on an end date and the range is filled in. The control works fine in it's own right, however, the page that contains the control doesn't seem to pull out the viewstate data from the control.
The viewstate is read in the control's Load event as below:
Partial Class Controls_Calendar
Inherits System.Web.UI.UserControl
Private m_MonthView As Integer
Private m_YearView As Integer
Private m_ArrivalDate As Date
Private m_DepartureDate As Date
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If ViewState.Item("MonthView") Is Nothing Then
ViewState.Add("MonthView", Date.Now.Month)
Me.m_MonthView = Date.Now.Month
Else
Me.m_MonthView = ViewState.Item("MonthView")
End If
If ViewState.Item("YearView") Is Nothing Then
ViewState.Add("YearView", Date.Now.Year)
Me.m_YearView = Date.Now.Year
Else
Me.m_YearView = ViewState.Item("YearView")
End If
If ViewState.Item("ArrivalDate") Is Nothing Then
Me.m_ArrivalDate = Nothing
Else
Me.m_ArrivalDate = ViewState.Item("ArrivalDate")
End If
If ViewState.Item("DepartureDate") Is Nothing Then
Me.m_DepartureDate = Nothing
Else
Me.m_DepartureDate = ViewState.Item("DepartureDate")
End If
If Not Page.IsPostBack Then
RenderCalendars()
End If
End Sub
The page tries to read the viewstate info:
Partial Class Pages_BookAccommodation_BookGlasgowAccommodation
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Trace.Write("Viewstate", ViewState.Item("ArrivalDate"))
If Not ViewState.Item("ArrivalDate") Is Nothing Then
Trace.Write("Viewstate", ViewState.Item("ArrivalDate"))
Me.lblFrom.Text = ViewState("ArrivalDate").ToString & " (2pm)"
End If
If Not ViewState("DepartureDate") Is Nothing Then
Me.lblTo.Text = ViewState("DepartureDate").ToString & " (10am)"
End If
End Sub
I have tried PreRender event as well to read the viewstate from the page codebehind but no success. The trace shows nothing.
Also, it might be worth mentioning that the page uses a master page???
Can any .net genius tell me where I might be going wrong?
Nelly.
|
|
|
|
|
Hi there,
The ViewState in the user control is different from that in the web page, they're all different dictionaries of data. So you cannot access the ViewState of the user control from the web page, what you may do is to read the ViewState from the user control, and expose it via a public property so that you can access from the web page.
|
|
|
|
|
I realised that after I posted the message. It came to me when I thought about what happens when you put 2 or more of a control on the same page.
I exposed the attributes of the control in public readonly properties. I then added the following to the page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myCalendar As ASP.controls_calendar_ascx = FindControl("Calendar1")
Trace.Write("Arrival Date", myCalendar.ArrivalDate.ToShortDateString)
Trace.Write("Departure Date", myCalendar.DepartureDate.ToShortDateString)
End Sub
The problem seems to be the FindControl returns nothing.
The page has the control added:
<uc1:Calendar ID="Calendar1" runat="server" />
This object is contained in a panel, the panel is in a ContentPlaceHolder.
Any Ideas?
Neil.
|
|
|
|
|
Basically, the FindControl method searchs for a specified control only within the scope of the current naming container. You now have a look at the your sample code again, you will see that the FindControl method in the Page_Load handler looks for the Calendar1 control in the scope of the Page instance whereas the Calendar1 is in the ContentPlaceHolder which is another naming container. So you first need to get reference to the ContentPlaceHolder control, then call its FindControl method to search for the Calendar1 in the scope of the ContentPlaceHolder. For more information, you can see Accessing ASP.NET Controls Programmatically [^]
|
|
|
|
|
Hi, I am Ravindra
please anybody tell me how to
implement ajax in ASP.net webapplication with easy steps
|
|
|
|
|
Hi,
I suggest working with Microsoft Atlas.
you can finf more details at atlas.asp.net
|
|
|
|
|
YossiKahlon wrote: I suggest working with Microsoft Atlas.
I REALLY wouldn't - overly complex, most of what it does isn't even ajax, and it's flaky as hell to boot. Oh and performance is crap. And it down;oads REAMS of js to the browser. Oh and did I mention it kills InetInfo process if you get things wrong hehe!
Just ask The Great God Google, and he'll show you the light
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
|
Hi, I am Ravindra learning ASP.net.
anybody please send me how to restrict selected webforms in asp.net using Authentication .
thanks in advance..
Ravindra
|
|
|
|
|
|
I have a pretty simple situation here. I have two DIVs, one of which has float left set and the other which has everything at default. In the left column I have an ASP.NET menu control. In the right column, I have some text.
In IE only, hovering over a menu item with submenu items makes the last couple of items disappear from my menu. However, if I resize the window so that the text on the right side is longer than the menu, the problem goes away. What could be causing this problem?
|
|
|
|
|
I figured out that it may not be the menu. I placed an hr element just below the menu. When I hovered over a menu item with sub items, the hr also disappeared. Any ideas?
|
|
|
|
|
AHA!
set the right hand div to float right. I can't believe I missed this. Everything else fell right into place.
|
|
|
|
|
Hello,
I created a webform.aspx with MS visual studio.net 2003.It has a listbox and a textbox.My page loads the listbox with list of name from a table(profile) from the database.when i select a name anomg the one loaded in the listbox, i want it to insert the personalID of the selected name from the same table(Profile) in the database.
After putting the code behind the page and text my web page, it will load the data from the profile table into the listbox successfully but when i select a name from the listbox, it won't insert the corresponding personalID into the textbox.Instead i get an error message that says [B]"Index 0 is not non-negative and below total row".
Please i need some one to help me correct my code.
Here is the code behinde the page:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If Not Me.IsPostBack Then
Dim SqlConnection1 As New System.Data.SqlClient.SqlConnection
SqlConnection1.ConnectionString = "data source=xuzia;initial catalog=Pinfol;user id=sa"
Dim cmd As New SqlClient.SqlCommand
cmd.CommandText = "SELECT PersonalID, Name FROM Profile"
cmd.CommandType = CommandType.Text
cmd.Connection = SqlConnection1
SqlConnection1.Open()
Dim DS As New DataSet
Dim DA As New SqlClient.SqlDataAdapter
DA.SelectCommand = cmd
DA.Fill(DS, "Profile")
ListBox1.DataSource = DS
ListBox1.DataMember = "Profile"
ListBox1.DataTextField = "Name"
ListBox1.DataValueField = "PersonalID"
ListBox1.DataBind()
SqlConnection1.Close()
End If
End Sub.
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
Dim prodID As Integer
prodID = ListBox1.SelectedIndex
Dim SqlConnection1 As New System.Data.SqlClient.SqlConnection
SqlConnection1.ConnectionString = "data source=xuzia;initial catalog=pinfo;user id=sa"
Dim SqlSelectCommand1 As New System.Data.SqlClient.SqlCommand
Dim cmd As New SqlClient.SqlCommand
cmd.CommandText = "SELECT PersonalID, Name FROM Profile WHERE PersonalID = " & prdID
cmd.CommandType = CommandType.Text
cmd.Connection = SqlConnection1
SqlConnection1.Open()
Dim DS As New DataSet
Dim DA As New SqlClient.SqlDataAdapter
DA.SelectCommand = cmd
DA.Fill(DS, "Profile")
txtID.Text = DataBinder.Eval(DS, "Tables[Profile].DefaultView.[0].PersonalID")
txtID.DataBind()
End Sub
I will appreciate all help.
Ktsis.
|
|
|
|
|
To start off, you don't need to run another sql query inside your index changed event handler. All that you are extracting from your query is PersonalID and Name . This information is already available to you in your ListBox since you bound the text field to Name and the value field to PersonalID . It looks like all you're doing is setting the txtID.Text to the value of PersonalID . You could probably replace all that event handler code with this:
txtID.Text = ListBox1.SelectedItem.Value
Logifusion[^]
|
|
|
|
|
You are using a variable "prdID" to create the SQL query, that you never assigned any value to.
I suppose that you meant to use the variable prodID instead.
You should use Option Explicit so that you can't use variables that you didn't create.
---
b { font-weight: normal; }
|
|
|
|
|
I need a calender control that should have the following features:
1. Its size should be a fixed one
2. User should not be allowed to select dates other than the current & future dates.
3. It should be movable within the page
4. The maximize button should be disabled
i need the calender control with above features so that i can use it in my asp.net webpage.
pl kindly help me
thanks a lot
arun hegde
|
|
|
|
|
I'm not sure if there is such a control that meets all what you need, but IMO you might want to check out the Peter's Date controls[^] , and consider using it with Atlas[^]
|
|
|
|
|
I want to create a page where when a user loads the page they are prompted to download a file? Like when you click on a link to download a file, but I want that prompt to come up when the page loads?
How do I do this?
/\ |_ E X E GG
|
|
|
|
|
On PageLoad of youe asp.net page use the following
Response.Redirect("mypdf.pdf")
This will ask for the pdf to get downloaded before the page is loaded.
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|