|
Hi Elizma,
I have the same problem with IIS 7 on Vista. After I modified my PNG files IIS did not refresh them, so I could see only the old version of them.
As a workaround I switched to VS 2008's Development Server (Project properties / Web / Servers / Use Visual Studio Development Server) as you did.
My only problem with this, that sometimes the Dev. Server handles the cookies incorrectly, I so need to switch back and forth between IIS and VS Dev. Server
Interestingly I had no problems on our production server.
I hope we'll get a proper fix soon...
Andras
|
|
|
|
|
Hi people, this is very very urgent. please help.
I have a user control which is being loaded dynamically. This user control is being placed ina place holder. The code is as follows:
UserControl ucUserControl = (UserControl)Page.LoadControl("../AM/UserControls/ucMyUserControl.ascx");
ucUserControl.ID = "userControl_ID";
phPlaceHolder.Controls.Add(ucUserControl);
Now,
I am trying to access the user control by using FindControl:
UserControl ucUserControl = (UserControl)phPlaceHolder.FindControl("userControl_ID");
The problem is the user control is not detected. That is,
ucUserControl = null
Please help guys. Thanks.
|
|
|
|
|
Use the following in your aspx page...
<%@ Reference Control="../AM/UserControls/ucMyUserControl.ascx" %>
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Hi,
I think I got this ASP.NET Server Control code from this site. It works in Firefox but not in IE (DotNetNuke). Does anyone know why? Or does anyone have a bespoke Map Control for Virtual Earth (just the code) which I can look at? I've tried Windows Live Tools and get querky errors....so thought I could adapt the code below to suit my needs
ASP.net 2.0
Language - VB
Site Content Manager – Dot Net Nuke
VB Code:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.Collections
Public Class MapControl
Inherits WebControl
#Region "Variables"
Private _dataSource As IEnumerable
Private _VarMap As String = "var map = null;"
Private _GetMapOpen As String = "function GetMap(){"
Private _CloseBracket As String = "}"
Private _LoadMap As String = "map.LoadMap();"
Private _PinId1 As String = "var pinid1=0;"
Private _Locs1Array As String = "var locs1 = new Array;"
Private _MapAddPushpin As String = "map.AddPushpin(pin);"
Private _IncrementPinId As String = "pinid1++;"
Private _Latitude As String = "47.6"
Private _Longitude As String = "-122.33"
Private _ZoomLevel As Integer = 10
#End Region
#Region "Properties"
Public Property DataSource() As IEnumerable
Get
Return _dataSource
End Get
Set(ByVal value As IEnumerable)
_dataSource = value
End Set
End Property
<Browsable(True), Category("Position")> _
Public Property Latitude() As String
Get
Return _Latitude
End Get
Set(ByVal value As String)
_Latitude = value
End Set
End Property
<Browsable(True), Category("Position")> _
Public Property Longitude() As String
Get
Return _Longitude
End Get
Set(ByVal value As String)
_Longitude = value
End Set
End Property
<Browsable(True), Category("Position")> _
Public Property ZoomLevel() As Integer
Get
Return _ZoomLevel
End Get
Set(ByVal value As Integer)
_ZoomLevel = value
End Set
End Property
#End Region
#Region "String Functions"
Private Function NewNamedMap(ByVal MapName As String) As String
Return "map = new VEMap('" & MapName & "');"
End Function
Private Function NewLocation(ByVal longatude As String, ByVal latitude As String) As String
Return "var loc = new VELatLong(" & longatude & "," & latitude & ");"
End Function
Private Function AddPushPin(ByVal Arr As String, ByVal Location As String) As String
Return Arr & ".push(" & Location & ");"
End Function
Private Function ForOpen(ByVal Arr As String) As String
Return "for (i=0; i < " & Arr & ".length; i++){"
End Function
Private Function RunBestMap(ByVal Arr As String) As String
Return "DoBestMap(" & Arr & ");"
End Function
#End Region
#Region "Map Strings"
Private Function MapWithDatasource() As String
Dim str As String = ""
str &= "<script "
str &= "type=""text/javascript"""
str &= ">"
str &= _GetMapOpen & _VarMap & NewNamedMap("MyNewMap") & _LoadMap
str &= _Locs1Array
str &= _PinId1
Dim DataEnum As IEnumerator
DataEnum = DataSource.GetEnumerator()
Dim i As Integer = 0
'str &= ForOpen("locs1")
While (DataEnum.MoveNext())
Dim st1, st2, st3, st4 As String
st1 = DataEnum.Current
DataEnum.MoveNext()
st2 = DataEnum.Current
DataEnum.MoveNext()
st3 = DataEnum.Current
DataEnum.MoveNext()
st4 = DataEnum.Current
str &= NewLocation(st1, st2)
str &= AddPushPin("locs1", "loc")
str &= "var pin = new VEPushpin(" & i.ToString & ", locs1[" & i.ToString & "], null, '" & st3 & "', '" & st4 & "');"
str &= "map.AddPushpin(pin);"
i += 1
End While
'str &= _CloseBracket
str &= "map.SetMapView(locs1);"
str &= _CloseBracket
str &= "</script>"
Return str
End Function
Private Function BasicMap() As String
Dim str As String = ""
str = "<script ""language=""JavaScript"">"
If Latitude <> "" And Longitude <> "" Then
str &= _GetMapOpen & _VarMap & NewNamedMap("MyNewMap") & _
"map.LoadMap(new VELatLong(" & Latitude.ToString & "," & Longitude.ToString & "), " & ZoomLevel.ToString & ",'h' ,false);" & _CloseBracket
Else
str &= _GetMapOpen & _VarMap & NewNamedMap("MyNewMap") & _LoadMap & _CloseBracket
End If
str &= "</script>"
Return str
End Function
#End Region
#Region "Control Methods"
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
MyBase.OnPreRender(e)
Dim meta As String = "<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"">"
Dim link As String = "<script type=""text/javascript"" src=""http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2""></script>"
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "Meta", meta)
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "Link", link)
Controls.Add(New LiteralControl("<div id='MyNewMap' style=""position:relative; width:600px; height:300px;""></div>"))
If Not _dataSource Is Nothing Then
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "OnLoad", MapWithDatasource)
Else
Me.Page.ClientScript.RegisterClientScriptBlock(GetType(String), "OnLoad", BasicMap)
End If
End Sub
Protected Overrides Sub OnDataBinding(ByVal e As EventArgs)
Controls.Clear()
End Sub
#End Region
End Class
|
|
|
|
|
Hi!
I have a project which I am currently working on and I am looking for some ideas on how you would create the solution.
I have multiple folders which all contain word documents and pdfs. The folders are organised by sections, almost like chapters in a book. I have one main folder, Technical, and within these folders I have "chapters" which also have "sub chapters" and some even have "sub, sub chapters".
Basically I have no control over how deep the chapters go.
Just now I have the main folder, within that folder I have chapters 1, 2, 3, 4 etc.
In folder 1 I then have more folders, 1.1, 1.2, 1.3, etc. within Folder 1.2 I have 1.2.1, 1.2.2, 1.2.3 etc, you get the idea.
What I would like to is create a visual representation of this so its easy to navigate via a website.
Ideally I would have something like this:
Technical.aspx (Main Section)
Chapter 1
Bit of a description of this chapter
Chapter 2
Bit of a decription of this chapter
Chapter 3
Bit of a description of this chapter.
etc....
Then someone clicks on Chapter 1 they get the same as above but with only Chapter 1's subchapters.
I am thinking about using a database so the descriptions can be stored in it.
Any thoughts on how to manage this would be great. Im still very new to C# ASP.net so any help you can give is much appriciated.
|
|
|
|
|
I think I have got a step further. I will create a single table in my database with the following columns.
ID, parentID, fileDescription
The ParentID will refer to the ID, but how could I create a webpage that dynamically displays only the relevant info.
i.e. The root page will only show items which don't have a parentID, the next webpage would only show the links that are relevant to it depending on which ID its just come from.
|
|
|
|
|
Hi friends,
I am in a strange problem. I have a swf object that shows the 3D view of a house. Now I need to embed the swf to a PDF so that it would work and play the 3d animation within the PDF itself. I know it could be done using Adobe Apollo, but it doesnt support to do this programmatically.
I want the user can download the pdf report with the flash object embeded within it.
Do you know how to do this? Any sdk that could work with .NET tech. iText is a library that does it, as they claims so, but it is in JAVA.
Regards
Abhishek
|
|
|
|
|
Hello,
I need to generate a few charts based on data stored in my database on SQL Server. I had no idea of how to generate charts with standard values itself.A little search on the Internet gave me the following code which works well:
Dim Image As New Bitmap(500, 300, PixelFormat.Format32bppRgb)
Dim g As Graphics = Graphics.FromImage(Image)
Dim redPen As New Pen(Color.Red, 10)
Dim blueBrush As New SolidBrush(Color.Blue)
Dim myImage As Bitmap
Dim p() As Integer = {1000000, 600000, 2500000, 80000}
Dim towns() As String = {"A", "B", "C", "D"}
Dim myBrushes(4) As Brush
myImage = New Bitmap(500, 300, PixelFormat.Format32bppRgb)
g = Graphics.FromImage(myImage)
' Create the brushes for drawing
myBrushes(0) = New SolidBrush(Color.Red)
myBrushes(1) = New SolidBrush(Color.Blue)
myBrushes(2) = New SolidBrush(Color.Yellow)
myBrushes(3) = New SolidBrush(Color.Green)
' Variables declaration
Dim i As Integer
Dim xInterval As Integer = 100
Dim width As Integer = 90
Dim height As Integer
Dim blackBrush As New SolidBrush(Color.Black)
For i = 0 To p.Length - 1
height = (p(i) \ 10000) ' divide by 10000 to adjust barchart to height of Bitmap
' Draws the bar chart using specific colours
g.FillRectangle(myBrushes(i), xInterval * i + 50, 280 - height, width, height)
' label the barcharts
g.DrawString(towns(i), New Font("Verdana", 12, FontStyle.Bold), Brushes.Black, xInterval * i + 50 + (width / 3), 280 - height - 25)
' Draw the scale
g.DrawString(height, New Font("Verdana", 8, FontStyle.Bold), Brushes.Black, 0, 280 - height)
' Draw the axes
g.DrawLine(Pens.Brown, 40, 10, 40, 290) ' y-axis
g.DrawLine(Pens.Brown, 20, 280, 490, 280) ' x-axis
Next
myImage.Save(Response.OutputStream, _
System.Drawing.Imaging.ImageFormat.Jpeg)
But now i need to know how in the p() array I can input values from the database dynamically i.e the number of values in the database could vary with time.The code should automatically input all the values in the table in the databse and generate the appropriate chart.How do i do this?
|
|
|
|
|
In programming practice, we mostly use classes in entity layer where only properties are there and no calculations at all.
In that scenario we can use structures also which will consume less momery and will be faster also.
For exmaple:
User.UserName, User.Password, etc.
What are the pros and cons if "User" is struct or Class.
Thanks.
|
|
|
|
|
|
Dear All,
I have created a web application which includes crystal report for reports. Now the problem is that my reports were not working on the webserver.
The Application works Perfectly on my local machine in IIS and in .net environment but if i upload the same application on the web server it shows the error.
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
What could be the solution
Thanks and Regards
Yogesh Agarwal
|
|
|
|
|
i feel it is not an error related to crystal report.
as we know custom error handlers are using for customise the default error pages.
custom error[^]
It may be some other error in you program
Do you have crystal report runtime installed on you web server?
|
|
|
|
|
Hi Thanks for the reply
I just want to check the report running on server or not. So i create a C.R. with no databinding, their is only a label in my C.R. that displays. This is my C.R.. So their is no programming involves there.
And about the runtime environment on server i have no idea.
Thanks
|
|
|
|
|
hi yogesh
for hosting are you using shared hosting server or dedicated server?
if it is dedicated server you can install crystal report runtime on your server.
|
|
|
|
|
Hi All..
I am just trying with Timer control in my web project. I have to check database at every minute and change the updates in my page.
How can I do?
Thanks in Advance
|
|
|
|
|
In the OnTick event of the Timer Control add your logic to check the database and do the necessary changes.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Ya...
My code is like..
<asp:timer id="NotificationTimer" runat="server" interval="15000" ontick="NotificationTimer_Tick">
protected void NotificationTimer_Tick(object sender, EventArgs e)
{
//My code to get data from db
}
Its working fine...But every 1 minute the page should refreshed so , remaining in the UpdatePanel like grid also loaded once again...
whats the problem?????? How to avoid this?
|
|
|
|
|
In my application i have to use a timer.Actually a print option which will be enabled after 5 min.after a print is done it will be disabled for 5 min,i.e no print will be done for next 5 min.After that one can print it.
How can it be achieved.
|
|
|
|
|
use SetInterval to increment a value after a certain interval.. and check if 5 min is elapsed.
After that make print enabled..
|
|
|
|
|
thanx for your response.
Can you explain it with an example.
|
|
|
|
|
Hi guys i am getting value in exponential
like :3.14765786987878E-6
I need thsi value in exact way
like : 0.00 some thing it has to come..,
I searched in google and tried in all the ways but i didnt get solution...,
plz help me,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Hi,
I am implementing auto complete extender in my project. I want a loading image to be displayed in the textbox while the data is being fetched from database and presented to the user.
<asp:TextBox id="TextBox2" Width="216px" runat="server" Text='<%# Bind("c_name") %>' autocomplete="off" ></asp:TextBox><br />
<br />
<cc1:AutoCompleteExtender id="AutoCompleteExtender1" runat="server" ServiceMethod="fetch" TargetControlID ="TextBox2" ServicePath="autocom.asmx" CompletionSetCount ="12" EnableCaching ="true" MinimumPrefixLength ="2"> <br />
</cc1:AutoCompleteExtender>
|
|
|
|
|
You can use AJAX UpdateProgress control to get that functionality. See here UpdateProgress control[^]
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
md_azy wrote: I want a loading image to be displayed in the textbox while the data is being fetched from database and presented to the user
use AJAX UpdateProgress Control.
|
|
|
|
|
1st Approach
<script type="text/javascript">
function ShowImage()
{
document.getElementById('txtAutoComplete')
.style.backgroundImage = 'url(images/loader.gif)';
document.getElementById('txtAutoComplete')
.style.backgroundRepeat= 'no-repeat';
document.getElementById('txtAutoComplete')
.style.backgroundPosition = 'right';
}
function HideImage()
{
document.getElementById('txtAutoComplete')
.style.backgroundImage = 'none';
}
</script>
Now write this code in Page_Load event of aspx page
protected void Page_Load(object sender, EventArgs e)
{
this.txtAutoComplete.Attributes.Add
("onkeypress", "ShowImage()");
this.txtAutoComplete.Attributes.Add
("onblur", "HideImage()");
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2nd approach
This approach works if you are using newer versions of AjaxControlToolkit.dll (Version 1.0.20229.20821 or later)
For this write the above mentioned javascript in head section of html markup of page.
Now in source of autocomplete extender add OnClientPopulating="ShowImage" and OnClientPopulated="HideImage"
<ajaxToolkit:AutoCompleteExtender runat="server"
ID="AutoComplete1"
BehaviorID="autoComplete"
TargetControlID="txtAutoComplete"
ServicePath="AutoComplete.asmx"
ServiceMethod="GetCompletionList"
MinimumPrefixLength="1"
CompletionInterval="10"
EnableCaching="true"
CompletionSetCount="12"
CompletionListCssClass=
"autocomplete_completionListElement"
CompletionListItemCssClass=
"autocomplete_listItem"
CompletionListHighlightedItemCssClass=
"autocomplete_highlightedListItem"
onclientpopulating="ShowImage"
onclientpopulated="HideImage">
</ajaxToolkit:AutoCompleteExtender>
<script type="text/javascript">
function ShowImage()
{
document.getElementById('txtAutoComplete')
.style.backgroundImage = 'url(images/loader.gif)';
document.getElementById('txtAutoComplete')
.style.backgroundRepeat= 'no-repeat';
document.getElementById('txtAutoComplete')
.style.backgroundPosition = 'right';
}
function HideImage()
{
document.getElementById('txtAutoComplete')
.style.backgroundImage = 'none';
}
</script>
|
|
|
|
|