|
i need to know about ajax
md_refay
|
|
|
|
|
|
|
Or buy a book. Geez.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
|
hi all please do help me
i have a gridview and i have filled it with the help sqldatasource.It contains 5 columns one of them is ber_id.
I have also enabled the edit update delete buttons...
now the question is when i edit the row i wanna limit the ber_id column that it should allow the user to type 7 characters only...
i have tried javascript but was not able to achieve this
how can i achieve this ?
|
|
|
|
|
Please read the forum guidlines. You cros-posted in THREE boards which is a no-no. Give your messages meaningful titles and not 'help me.'
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
Hello
I'm having a go at using web user controls and url rewritting in asp.net 1.1 (vb) and I'm having a problem with urls, here is what I want to do:
1. I want to use one .asx page for all my UI and load user controls depending on what is clicked by user (as a master page would do in .net 2.0)
2. My hyperlink controls' NavigateUrl property have the virtual path for the user control to load (set in the designer)
3. In Application_BeginRequest method I get the virtual path part from the request and use context.rewritepath to my .aspx page with the virtual path as a querystring
MY PROBLEM:
The string in the request.rawurl keeps getting longer every time i click a link. The virtual path keeps getting appended to the url each time.
Please help!! (I'm a newbie in this area)
Thanks
George
Standing on the shoulders of a giant
|
|
|
|
|
1. I want to use one .asx page for all my UI and load user controls depending on what is clicked by user (as a master page would do in .net 2.0)
This is a bit of a misconception, as master pages in 2.0 still use multiple pages, albeit content pages. The content pages are not controls, they are actually pages that basically include the master page.
3. In Application_BeginRequest method I get the virtual path part from the request and use context.rewritepath to my .aspx page with the virtual path as a querystring.
Can you show how your doing this? I would use an http module for this, there are many examples of this on the web.
A snippet would look something like this:
Private Sub Application_BeginRequest( _
ByVal source As Object, _
ByVal e As EventArgs)
Dim application As HttpApplication = CType(source, HttpApplication)
Dim context As HttpContext = application.Context
Dim addressbar As String = context.Request.RawUrl.ToString()
'Do something with the url, db lookup, etc..
context.Response.Redirect("http://www.HERE.com/", True)
End If
|
|
|
|
|
Thanks here is the code:
----------------------------------------------------
Dim sPath As String = Request.Path.ToLower
Dim iStart As Integer = sPath.LastIndexOf("/") + 1
Dim iFirst As Integer = sPath.IndexOf("/", 0) + 1
Dim sPage As String
Dim sVirtualDirectory As String
Dim sPage2 As String
Dim sQS As String = Request.QueryString.ToString
Dim cnfg As New ConfigurationHelper(Request.PhysicalApplicationPath & "Config\config.xml")
Dim sDefaultPageName As String = cnfg.GetString("DefaultPage")
sVirtualDirectory = sPath.Substring(0, sPath.IndexOf("/", 1))
If (sPath.IndexOf(".aspx") - iStart) > 0 Then
sPage = sPath.Substring(iStart, sPath.IndexOf(".aspx") - iStart)
sPage2 = sPath.Substring(0, sPath.IndexOf(".aspx"))
End If
Select Case sPage
Case sDefaultPageName.ToLower
Context.RewritePath(sVirtualDirectory & "/" + sDefaultPageName + ".aspx")
Case Else
Context.RewritePath(sVirtualDirectory & "/" + sDefaultPageName + ".aspx" & "?page=" & sPage2 & "&" & sQS)
End Select
---------------------------------------------------------------------------------------
On the first time the page is loaded it all works fine, but on subsequent clicks on hypelinks in the user controls the rawurl concatinates the path of control
-- modified at 2:51 Friday 20th July, 2007
|
|
|
|
|
Dim sPath As String = Request.Path.ToLower
Dim iStart As Integer = sPath.LastIndexOf("/") + 1
Dim iFirst As Integer = sPath.IndexOf("/", 0) + 1
Dim sPage As String
Dim sVirtualDirectory As String
Dim sPage2 As String
Dim sQS As String = Request.QueryString.ToString
Dim cnfg As New ConfigurationHelper(Request.PhysicalApplicationPath & "Config\config.xml")
Dim sDefaultPageName As String = cnfg.GetString("DefaultPage")
sVirtualDirectory = sPath.Substring(0, sPath.IndexOf("/", 1))
If (sPath.IndexOf(".aspx") - iStart) > 0 Then
sPage = sPath.Substring(iStart, sPath.IndexOf(".aspx") - iStart)
sPage2 = sPath.Substring(0, sPath.IndexOf(".aspx"))
End If
Select Case sPage
Case sDefaultPageName.ToLower
Context.RewritePath(sVirtualDirectory & "/" + sDefaultPageName + ".aspx")
Case Else
Context.RewritePath(sVirtualDirectory & "/" + sDefaultPageName + ".aspx" & "?page=" & sPage2 & "&" & sQS)
End Select
|
|
|
|
|
have you tried stepping through this line by line using the debugger. This would tell you what conditions are being met and which case statements are being used.
How are you links getting their values? Chances are they are getting the wrong value from the get go.
Can you provide two examples of what the links look like? One for the intial load, and another for after you click on a link.
|
|
|
|
|
In the designer I set the NavigateUrl for the HyperLink to "UsrControl/NetworkUI/UC_CategoriesList.aspx" (the .aspx extention is just so it looks as page when user hovers over link in browser).
This is the rawurl which I get in Application_BeginRequest when I click the hyperlink for the first time. "UsrControl/NetworkUI/UC_CategoriesList.aspx" which is fine.
When I click the second time I hit the Case Else part:
Context.RewritePath(sVirtualDirectory & "/" + sDefaultPageName + ".aspx" & "?page=" & sPage2 & "&" & sQS)
at this point the url is now "UsrControl/NetworkUI/UsrControl/NetworkUI/UC_CategoriesList.aspx".
and with subsequent clicks it keeps appending "UsrControl/NetworkUI" to the url.
and all links on the user control have their url changed as well
In the user control Page_load the NavigateUrl for the hyperlink is still set the one I set in Designer
This can be reproduced by creating an asp.net project and add a page. Add a folder and add a user control in the folder,drop a hyperlink on the user control and set the NavigateUrl to something.
rewrite the path (context.rewritepath) to the page in Application_BeginRequest (so you can be able to click more than once)
and check the rawurl every time you click.
Thanks
|
|
|
|
|
Hi,
I am looking for just a plain calendar on the page. I just need to display the days and if a property is booked I must display the day block as another colour. This I havem but the day number have a link. How do I remove the link so that the day number is just plain text?
I am using the asp:Calendar control.
Regards
ma se
|
|
|
|
|
This is what Microsoft help has on marking days as selectable:
VB.net
Protected Sub Calendar1_DayRender(ByVal sender As Object, _
ByVal e As DayRenderEventArgs) Handles Calendar1.DayRender
Dim myAppointment As Date = New Date(2005, 10, 1)
If (e.Day.Date = myAppointment) Then
e.Day.IsSelectable = True
Else
e.Day.IsSelectable = False
End If
End Sub
C#
protected void Calendar1_DayRender(object sender,
DayRenderEventArgs e)
{
DateTime myAppointment = new DateTime(2005, 10, 1);
if (e.Day.Date == myAppointment)
{
e.Day.IsSelectable = true;
}
else
{
e.Day.IsSelectable = false;
}
}
Ben
|
|
|
|
|
Any one know (prefer some sample source code) for below two queries:
a) How I can use FormView (insert Template) in unbound behavior. I want to write my own insert statements rather than using SQLDataSource cmmandname=”insert” etc…
b)I also need to do data validation of formview controls through java script.
Thanks
Amit
|
|
|
|
|
I know this but problems is here i have to hard code control names...
(FormView1.FindControl("TxtFName"))).Text.ToString();
|
|
|
|
|
I have an *extremely* basic question. Much of the code below has been lifted from Scott Hilier's book on MOSS. I have also asked him this question with no response as yet.
When I click on a button in a sharepoint web part, I think it should run the method I associate:
protected override void CreateChildControls()
{
m_button = new Button();
m_button.Text = "Push Me!";
m_button.Click += new EventHandler(m_button_Click);
Controls.Add(m_button);
}
protected override void RenderContents(HtmlTextWriter writer)
{
m_button.RenderControl(writer);
}
void m_button_Click(object sender, EventArgs e)
{
m_report += "Button Click ";
}
...The problem is that "Button Click" is never reached. It does post back, but it does not reach my breakpoint and does not write the text.
Ideas appreciated.
Cheers,
Daaron
|
|
|
|
|
Hi, I get the error message " Name 'parse' is not declared" in the following code.
Try<br />
_con.Open()<br />
Dim _cmd As OdbcCommand = _con.CreateCommand()<br />
_cmd.CommandText = "select Resumes from" + " Contenttbl where id='" + id + "'"
Dim _buf As Byte() = CByte(parse(_cmd.ExecuteScalar()))
Response.BinaryWrite(_buf)<br />
Catch<br />
Finally<br />
<br />
_con.Close()<br />
End Try
Isn't Parse a method name, why would I have to declare it if its a built-in method in VB.net? I have tried changing the line
Dim _buf As Byte() = CByte(parse(_cmd.ExecuteScalar()))
to
Dim _buf As Byte = CByte(_cmd.ExecuteScalar())
but it didn't work. I got the error "Value of type 'Byte' cannot be converted to '1-dimensional array of Byte'" on the line Response.BinaryWrite(_buf) , when I did that. At this point I really don't know what else to do, please help me solve the problem. Thank you in advance for your help.
-- modified at 12:36 Thursday 19th July, 2007
|
|
|
|
|
I am not sure but it could be that cbyte is returning a single byte rather than a byte array
Try
Dim _buf as byte() = ctype(cmd.ExecuteScalar(), byte())
|
|
|
|
|
Hi, thanks for responding, your suggestion did not work and it generates two errors.
1) On line Dim _buf as byte() = ctype(cmd.ExecuteScalar(), byte()) , the error
'(' expected is given.
2) On line Response.BinaryWrite(_buf) , the error _buf is not declare is given.
I have tried changing Dim _buf as byte() to Dim _buf() as byte, but that didn't help.
|
|
|
|
|
HI
I am tryin to make a simple session which should pass the verified username accross to the user home page
and display the username in a label
i have the following
Dim uname As String = txtUserName.Text
Session("username") = uname
and i am tryin to catch it using the following
Dim username As String
username = Request.QueryString.Get("username")
lblUsername.Text = username
i have also tried, to no avail
username = ctype(session("username"),string)
Anyone see a problem
boy
|
|
|
|
|
//Dim uname As String = txtUserName.Text
//Session("username") = uname
Check the uname is empty or not.
i think you are trying to use the querystring value to set it in username.
so check whether the username is empty or not.
//Dim username As String
//username = Request.QueryString.Get("username")
//lblUsername.Text = username
IF everything is ok ,then it will surely work.
All The Best
Sathesh Pandian
|
|
|
|
|
username = Request.QueryString.Get("username")
username = Session("username").ToString()
|
|
|
|
|
still no joy
|
|
|
|