|
i am geeting this error. I am using vb.net 2005 on windows server 2003.
Unable to start debugging on the web server.
when running my asp.net pages with iis.
I checked my iis, it was showing -
Default web site(Stopped)
I tried to start it by right-click the default web site, and Restart.
It did not start teh IIS
I went to the command prompt, and run iisreset
the is still showing stopped
pls help
t.aransiola
|
|
|
|
|
Can you look at the event log ? Is there any error related to W3C service or IIS?
|
|
|
|
|
Also did you enable Windows Authentication for the website?
|
|
|
|
|
Windows Authentication was enabled on the IIS.
This has not solve the problem.
Can i develop my asp.net pages using the File System instead of IIS when done, now create a virtul directory from IIS. I dont know whether this approach has any drawbacks
pls anyone with a solution should help
t.aransiola
|
|
|
|
|
I have a custom server control that behave like an image button and a image map. I implement both IPostBackDataHandler and IPostBackEventHandler interface. I place Page.ClientScript.GetPostBackEventReference(MycontrolID, "") on the page's Page_Init() subroutine. I also code all the javascript function. On my test page, I have my custom control and a button. When I click my custom control, my RaisePostBackEvent gets call properly and I got the correct argument passed in from postback. However, when I put my custom control on the content page along with 10 other button and image button, my RaisePostBackEvent no longer get call. Even though my viewstate and control state continues to get process properly. I do not understand why. Can anyone help me ? I have been stuck on this for a week.
Source code for control
Namespace CustomControls
Public Class TooltipImageButton
Inherits WebControl
Implements IPostBackDataHandler
Implements IPostBackEventHandler
Public Event TooltipImageButtonClick As EventHandler(Of TooltipImageButtonEventArgs)
Protected m_hotSpots As ImageHotSpotCollection
Protected m_imageUrl As String
Public Property ImageUrl() As String
Get
Return m_imageUrl
End Get
Set(ByVal Value As String)
m_imageUrl = Value
End Set
End Property
Public Sub New()
m_hotSpots = New ImageHotSpotCollection
m_imageUrl = ""
End Sub
Public Sub AddHotSpot(ByVal hotSpot As ImageHotSpot)
Try
m_hotSpots.Add(hotSpot)
Catch ex As Exception
End Try
End Sub
Public Function GetHotSpot(ByVal i As Integer) As ImageHotSpot
If m_hotSpots.Count < 1 Then
Return Nothing
Else
Return m_hotSpots.Item(i)
End If
End Function
Public Function GetHotSpot(ByVal id As String) As ImageHotSpot
If m_hotSpots.Count < 1 Then
Return Nothing
Else
Return m_hotSpots.Item(id)
End If
End Function
Public Function HotSpotCount() As Integer
Return m_hotSpots.Count
End Function
Public Sub clear()
m_hotSpots.Clear()
End Sub
Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
MyBase.OnInit(e)
End Sub
'***********************************************************************************
'IPostBackDataHandler methods - Get call first
'***********************************************************************************
' Return true if the server control's state changes as a result of the postback; otherwise, false.
Public Overridable Shadows Function LoadPostData(ByVal postDataKey As String, _
ByVal postCollection As System.Collections.Specialized.NameValueCollection) _
As Boolean Implements IPostBackDataHandler.LoadPostData
Dim presentValue, postedValue As String
postedValue = postCollection(postDataKey)
Return True
End Function
Public Overridable Shadows Sub RaisePostDataChangedEvent() _
Implements IPostBackDataHandler.RaisePostDataChangedEvent
End Sub
'***********************************************************************************
'IPostBackEventHandler methods - Get call after RaisePostDataChangedEvent()
'***********************************************************************************
Public Sub raisepostbackevent(ByVal eventArgument As String) Implements IPostBackEventHandler.RaisePostBackEvent
Dim i As Integer
Dim str, strArgument As String
Dim controlEvent As New TooltipImageButtonEventArgs()
'strArgument = eventArgument
strArgument = Page.Request("__EVENTTARGET")
If strArgument <> Me.ID Then Return
strArgument = Page.Request("__EVENTARGUMENT")
i = strArgument.IndexOf(",")
If i < 1 Then Return
str = strArgument.Substring(0, i)
controlEvent.x = Convert.ToInt32(str)
str = strArgument.Substring(i + 1)
controlEvent.y = Convert.ToInt32(str)
If controlEvent.x < 0 Then controlEvent.x = 0
If controlEvent.y < 0 Then controlEvent.y = 0
RaiseEvent TooltipImageButtonClick(Me, controlEvent)
End Sub
'***********************************************************************************
'Control State methods - Get call after raisepostbackevent()
'***********************************************************************************
Protected Overrides Function SaveControlState() As Object
Return m_hotSpots
End Function
Protected Overrides Sub LoadControlState(ByVal savedState As Object)
If (savedState Is Nothing) Then
Return
End If
m_hotSpots = CType(savedState, ImageHotSpotCollection)
End Sub
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
MyBase.OnPreRender(e)
Page.RegisterRequiresControlState(Me) 'Need this line to load/save control save
If Not Page.ClientScript.IsClientScriptIncludeRegistered("ImageTooltip") Then
Page.ClientScript.RegisterClientScriptInclude("ImageTooltip", Page.ResolveClientUrl("~/ClientScripts/ImageTooltip.js"))
End If
End Sub
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
Dim hotspot As ImageHotSpot
Dim i As Integer
writer.AddAttribute("onload", "javascript:return SetID('" & Page.Form.ClientID & "','" _
& Me.ClientID & "','" & Me.ID & "')")
'Custom postback javascript that will call: __doPostBack(eventTarget, eventArgument) via postBack(event)
writer.AddAttribute("onclick", "javascript:return postBack(event)")
writer.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "hand")
writer.AddAttribute(HtmlTextWriterAttribute.Width, Me.Width.ToString)
writer.AddAttribute(HtmlTextWriterAttribute.Height, Me.Height.ToString)
writer.AddAttribute(HtmlTextWriterAttribute.Src, Page.ResolveClientUrl(Me.ImageUrl))
writer.AddAttribute(HtmlTextWriterAttribute.Id, Me.ClientID)
writer.AddAttribute(HtmlTextWriterAttribute.Name, Me.UniqueID)
writer.AddAttribute("visible", Me.Visible.ToString)
writer.AddAttribute(HtmlTextWriterAttribute.Usemap, "#MapID")
writer.AddAttribute(HtmlTextWriterAttribute.Border, "0")
writer.AddAttribute("runat", "server")
writer.RenderBeginTag(HtmlTextWriterTag.Img)
writer.AddAttribute(HtmlTextWriterAttribute.Id, "MapID")
writer.AddAttribute(HtmlTextWriterAttribute.Name, "MapID")
writer.RenderBeginTag(HtmlTextWriterTag.Map)
Try
For i = 0 To m_hotSpots.Count - 1
hotspot = m_hotSpots.Item(i)
If hotspot.Show Then
writer.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "hand")
writer.AddAttribute("shape", "circle")
writer.AddAttribute(HtmlTextWriterAttribute.Coords, hotspot.CenterPoint.x & "," & hotspot.CenterPoint.y & "," & hotspot.Radius)
writer.AddAttribute("onmouseover", "javascript:return MouseOver('" & hotspot.Tooltip & "')")
writer.AddAttribute("onmouseout", "javascript:return MouseExit()")
writer.RenderBeginTag(HtmlTextWriterTag.Area)
writer.RenderEndTag()
End If
Next
Catch ex As Exception
End Try
writer.WriteEndTag("map")
End Sub
End Class
Public Class TooltipImageButtonEventArgs : Inherits EventArgs
Protected m_x As Integer
Protected m_y As Integer
Public Sub New()
m_x = 0
m_y = 0
End Sub
Public Sub New(ByVal x As Integer, ByVal y As Integer)
m_x = x
m_y = y
End Sub
Public Property x() As Integer
Get
Return m_x
End Get
Set(ByVal Value As Integer)
m_x = Value
End Set
End Property
Public Property y() As Integer
Get
Return m_y
End Get
Set(ByVal Value As Integer)
m_y = Value
End Set
End Property
End Class
End Namespace
Rookie Programmer
|
|
|
|
|
Hi, I am indeed got stuck in this ajax. All I want to do is to update the modalpopup label and textfield values when user click on the ok button. Although, my modalpopup works but when I
re-click to open the modalpopup the values don't get updated. Below are my codes, can somebody please really help me. I appreciate
Thanks
<<asp:linkbutton id="LinkButton1" runat="server">>LinkButton<>
<<ajaxtoolkit:modalpopupextender id="ModalPopupExtender1" runat="server"
="" targetcontrolid="LinkButton1" popupcontrolid="Panel1" okcontrolid="btnOk" cancelcontrolid="btnCancel">>
<<asp:panel id="Panel1" runat="server">>
<<asp:updatepanel id="UpdatePanel1" runat="server">>
<<contenttemplate>>
<<asp::label id="Label1" runat="server">>Label<>
<<asp:textbox id="TextBox1" runat="server">>TextBox<>
<>
<<triggers>><<asp:asyncpostbacktrigger controlid="btnOk" eventname="Click">> <>
<>
<<asp:button id="btnOk" runat="server" text="OK" onclick="btnOk_Click">>
<<asp:button id="btnCancel" runat="server" text="Cancel">>
<>
//protected void btnOk_Click(object sender, EventArgs e)
//{
// this.TextBox1.Text = "textfield change";
// this.Label1.Text = "label change";
// }
|
|
|
|
|
do not declare the OkControlID ="btnOk" in the modalpopup.
|
|
|
|
|
Hi, I am indeed got stuck in this ajax. All I want to do is to update the modalpopup label and textfield values when user click on the ok button. Although, my modalpopup works but when I
re-click to open the modalpopup the values don't get updated. Below are my codes, can somebody please really help me. I appreciate
Thanks
<asp:linkbutton id="LinkButton1" runat="server">LinkButton
<ajaxtoolkit:modalpopupextender id="ModalPopupExtender1" runat="server"
="" targetcontrolid="LinkButton1" popupcontrolid="Panel1" okcontrolid="btnOk" cancelcontrolid="btnCancel">
<asp:panel id="Panel1" runat="server" height="185px" width="195px"> --%>
<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:label id="Label1" runat="server">Label
<asp:textbox id="TextBox1" runat="server">TextBox
<triggers><asp:asyncpostbacktrigger controlid="btnOk" eventname="Click">
<asp:button id="btnOk" runat="server" text="OK" onclick="btnOk_Click">
<asp:button id="btnCancel" runat="server" text="Cancel">
protected void btnOk_Click(object sender, EventArgs e)
{
this.TextBox1.Text = "textfield change";
this.Label1.Text = "label change";
}
|
|
|
|
|
I need help in adding a hyperlink to a column dynamically using a gridview in asp.net. This is the code that I have now. It displays three columns populated with data and i want to hyperlink the name column that is created in the program.
Dim _Table As New DataTable
Dim _Row As DataRow
'Create the columns
Dim _seopName As New DataColumn("Name", GetType(String))
Dim _seopType As New DataColumn("Type", GetType(String))
Dim _key As New DataColumn("Key", GetType(String))
'Add the columns to the DataTable's Columns collection
_Table.Columns.Add(_seopName)
_Table.Columns.Add(_seopType)
_Table.Columns.Add(_key)
Dim seopname As String
Dim seoplname As String
Dim seopkey As String
Dim seoptyp As String
Dim sifld1 As Integer
Dim sifld2 As Integer
Dim sifld3 As Integer
Dim sifld4 As Integer
Dim seopConn As String = GIS.Common.GISGlobal.GetKey("seopconn")
If mRecordset.Count > 0 Then
If mRecordset.MoveFirst Then
sifld1 = lay.ReturnFieldIndex(mRecordset, seopConn & "FNAME")
sifld2 = lay.ReturnFieldIndex(mRecordset, seopConn & "LNAME")
sifld3 = lay.ReturnFieldIndex(mRecordset, seopConn & "KEY")
sifld4 = lay.ReturnFieldIndex(mRecordset, seopConn & "SUB_TYPD")
Do While Not mRecordset.EOF
_Row = _Table.NewRow
seopkey = Trim(mRecordset.Fields.FieldValueAsString(CLng(sifld4)))
_Row("type") = seopkey
seopname = Trim(mRecordset.Fields.FieldValueAsString(CLng(sifld1)))
seoplname = Trim(mRecordset.Fields.FieldValueAsString(CLng(sifld2)))
_Row("Name") = seopname & " " & seoplname
seoptyp = Trim(mRecordset.Fields.FieldValueAsString(CLng(sifld3)))
_Row("Key") = seoptyp
'Updated for Map It option
_Table.Rows.Add(_Row)
mRecordset.MoveNext()
Loop
End If
End If
Dim sReport As New DataTable
'Create the columns
Dim _sName As New DataColumn("Name", GetType(String))
Dim _sType As New DataColumn("Type", GetType(String))
Dim _sKey As New DataColumn("Key", GetType(String))
'Add the columns to the DataTable's Columns collection
sReport.Columns.Add(_sName)
sReport.Columns.Add(_sKey)
sReport.Columns.Add(_sType)
Dim mReport As DataView
mReport = _Table.DefaultView
'for Map It option
If mReport.Count = 0 Or mReport.Count < 0 Then
litReport.Text = "No Records Found for Sexual Predator/Offender Buffer Map."
litReport.Visible = True
gd_seop.Visible = False
Else
'Add Row for GOB records
litReport.Visible = False
' dvReport.RowFilter = "Source" & "='LSCHOOLS'"
gd_seop.DataSource = mReport
gd_seop.DataBind()
gd_seop.Visible = True
'Print Option
' _GISBasePage.MapParameter.ReportTable = showReport
End If
End If 'IF
|
|
|
|
|
Will there always be a hyperlink and it is just a matter of what the link points to? If that is the case you just need to do some custom binding using a Templatefield with a hyperlink control. You can bind the hyperlink properties to the correct values from your data table. Anyway hope that helps.
Ben
|
|
|
|
|
Hallo,
i want to close my PopUP Page, in codebehind???
Please help me...
|
|
|
|
|
That is not possible, as the server code is run on the server, and window that you want to close only exists in the browser.
What you have to do is to put Javascript code on the page that you are creating, that will close the window.
Example:
Page.ClientScript.RegisterStartupScript(this.getType(), "Close", "window.close();", true);
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I have a page with a Panel control with its Visible property set to false in the markup. I've then got a button event handler that sets this to true. When the page renders this has somehow found its way back to false. Using some logging and debugging I've determined that the event is definately working as expected, but by the time the OnPreRender event fires the property has changed back.
Can anyone explain this?
protected override void OnPreRender(EventArgs e)
{
log.Debug("PreRender, visible: " + AccessInfoContentPanel.Visible);
base.OnPreRender(e);
}
private void ToggleContent()
{
if (AccessInfoContentPanel.Visible == false)
{
log.Debug("content made visible: ");
AccessInfoContentPanel.Visible = true;
AccessInfoContentPanel.Enabled = true;
}
else
{
log.Debug("content removed: ");
AccessInfoContentPanel.Visible = false;
AccessInfoContentPanel.Enabled = false;
}
}
protected void ToggleBtn_ServerClick(object sender, EventArgs e)
{
ToggleContent();
}
Cheers!
|
|
|
|
|
My guess is that the initial setting the panel to visible = false might be happening in the page load as well? Or perhaps you have viewstate turned off? That is where I have usually found these bugs. I have done some very similar things in ASP.net.
NOTE a better way to do what you are trying to do might be to use a PlaceHolder control instead.
Anyway, hope that helps.
Ben
|
|
|
|
|
I've experienced an issue in the past where changes in the browser do not make it to the server code when a control is disabled.
Test the same code with AccessInfoContentPanel always enabled. You may want to enable before changing visible to true.
|
|
|
|
|
I have the page break problem in my report. In the report first I placed a table with contains 50 rows(data will be shown in two pages) and after the table I placed the matrix object becuase the number of cols is not fixex. The problem is that if the number of columns in the matrix is greater than 10 then it prints the remaining columns in the next page but at the same I am getting the page breaks in the first table i.e between 1St and 2nd page I am getting page break.
How can I delete the page breaks.
Kalyan
|
|
|
|
|
Hello guys,
I have a lot of documents in filesystem of a web server (1). An other web server (2) should offer access to this documents too. That works fine and my generated links to the documents will load the document inside the browser.
My problem is, the documents (the name, not the data !!!) and the path are administer in a database and I have a test, if the document exist, before I provide the link. The code for test is follows:
fi = New FileInfo(strPhysPath)
If fi.Exists = False Then
' do an error message here
else
' generate a link
end if
For this check I need a physical path and I have it in different ways. As "normal path" (i.e. "x:\documents\pdf\test.pdf"), if the code runs on web server1 (the server, where the documents are stored), as UNC-Path to a shared folder (i.e. "\\server1\documents\pdf\test.pdf") and/or as a network drive path using the shared folder (i.e. "y:\pdf\test.pdf" where y: -> \\server1\documents). The last both variants I must use on web server2 and here I get always: File not exist using the code above. No errors, no execptions.
Why? Did anybody have other ideas ?
Thank you very much
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=http:
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Well, If you are using a normal default app pool for this website most likely you are trying to access these files with the aspnet user. My guess would be that this user does not have file permissions to read the directory. NOTE if you do give aspnet user read permissions to the directory it can be a security issue.
The only other thing I can think of is using the System.IO.File.Exists instead of using the FileInfo class.
Hope that helps.
Ben
|
|
|
|
|
Hello Ben,
An application pool is it not and this is not possible.
Your second idea works, but I have also a test for the filelength (System.IO.FileInfo.Length). Did you have an idea to change this part too?
Thanks
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=http:
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Since you are using VB.net you can try:
Dim MySize As Long
' Returns file length (bytes).
MySize = FileLen("TESTFILE")
Otherwise you are stuck with the FileInfo Class
Ben
|
|
|
|
|
i have this scene
i have load x page.aspx this page call a function javascript this function call a web service it receives a string
next
in my page have a hidden field it is a hidden texbox and the javascritp function pass the value to a hidden texbox
example
client side
window.Form1.lblRid.value = cadena[0];
when the user postback i use the hidden field to x actions
example
server side
If lblRid.Text <> "" Then
this technique is very bad could that to create an hidden field for each occasion
thanks for the time
|
|
|
|
|
I would suggest instead using a hidden field like this:
In the javascript you can do this:
document.getElementById("content").value =
This in your .net code behind you can do this:
Request.Form["content"].ToString();
Hope that helps.
Ben
|
|
|
|
|
ya. i think, using hidden field is an idea..
Maybe, you can also read "Accessing the Client-side variable (variable named “str” in this sample ) from Server-side Code" from article.
|
|
|
|
|
i have limited the max length of the text box through javascripting .When the users wants to add more text the label on the page should read a message like maximum text has exceeded ...
The problem is through javascripting i am not getting the label control.
help!!
thanks in advance .
|
|
|
|
|
document.getElementById("label1").innerText = "maximum text has exceeded "
Regards,
Sylvester G
Senior Software Engineer
Xoriant Solutions
sylvester_g_m@yahoo.com
|
|
|
|