 |
 |
Index ‹ dotnet-framework-aspnet
|
- Previous
- 1
- Problems installing Express version of ASP.NETI have downloaded, saved the install file and attempted to run. I have also
downloaded and "Run" the file.
No joy. I end up with a small dialog with progress bar indicating that it
could take a couple of minutes. That was 20 minutes ago. I have had to
kill this too many times now.
Has anyone had a similar problem or had this work?
Lloyd Sheen
- 2
- Binding data to datagrid header template on button clickDear all i want to bind data to the controls in the datagrid header
template on button click event which is not in the datagrid . i am
writting following code but it gives an error.
can any one tell me what is the solution behind them.
private void search_Click(object sender, System.EventArgs e)
{
selectQuery();
}
private void selectQuery()
{
try
{
strcondition="select * from Student"
DataView dv ;
dv =
VS.DAC.PDMO.GeneralDesMng.SearchSectionsLinesByDistrict(strcondition);
if (dv.Count > 0)
{
Label number_Label =
(Label)searchResult_DataGrid.FindControl("numHeader_Label");
number_Label.Text=
dv[0]["NumUnit"].ToString();
Label capacity_Label =
(Label)searchResult_DataGrid.FindControl("capHeader_Label");
capacity_Label.Text
=dv[0]["CapUnit"].ToString();
Label address_Label =
(Label)searchResult_DataGrid.FindControl("addrHeader_Label");
address_Label.Text=dv[0]["AddrUnit"].ToString();
}
searchResult_DataGrid.DataSource = dv;
searchResult_DataGrid.DataBind();
}
catch(Exception ex)
{
Response.Write("<script
language=Javascript> alert('"+
ex.Message.ToString()+"') ;</script>");
}
}
- 2
- Reason for Shutdown: HostingEnvironmentIn my Application_End method in Global.asax, I log the shutdown reason
(System.Web.Hosting.HostingEnvironment.ShutdownReason) and any errors
returned from Server.GetLastError(). Occasionally (2-3 times a day) I get a
shutdown for reason HostingEnvironment, with no errors.
Can anyone tell me what this is about?
(I'm running ASP.NET 2.0)
--
Robert Dunlop
----------------
http://www.directxzone.org
http://rdunlop.spaces.live.com/
Microsoft DirectX MVP 1998-2006
- 4
- how to use DynamicInvoke method to return a valueusing System;
using System.Windows.Forms;
using System.Threading;
using System.ComponentModel;
namespace ProgressControl.Core
{
public delegate object Execute(params object[] args);
public class ProgressController
{
#region Construct
public ProgressController(ProgressBar bar)
{
this.bar = bar;
InitComponet();
}
#endregion
#region Property
private Execute exec;
public Execute ExecuteHandle
{
set { exec = value; }
}
private ProgressBar bar;
/// <summary>
/// </summary>
public ProgressBar Bar
{
get { return bar; }
set { bar = value; }
}
private ProgressBarStyle defaultStyle =
ProgressBarStyle.Blocks;
/// <summary>
/// </summary>
public ProgressBarStyle DefaultStype
{
get { return defaultStyle; }
set { defaultStyle = value; }
}
private object result = null;
public object Result
{
get { return result; }
}
private BackgroundWorker backWorker = new BackgroundWorker();
#endregion
#region Public
/// <summary>
///
/// </summary>
/// <returns></returns>
public void AsyncDo(params object[] args)
{
if (backWorker.IsBusy) throw new Exception("Another
process is processing.");
backWorker.RunWorkerAsync(args);
}
/// <summary>
///
/// </summary>
/// <param name="min"></param>
/// <param name="max"></param>
/// <param name="step"></param>
/// <returns></returns>
public void AsyncDo(int min, int max, int step, params
object[] args)
{
//if (backWorker.IsBusy) throw new Exception("Another
process is processing.");
//int count = (int)((max - min) / step);
//do
//{
// if (backWorker.IsBusy) continue;
// if (count > 0)
// {
// backWorker.RunWorkerAsync(args);
// ReportProgress(count);
// count--;
// }
// else
// break;
//}
//while (true);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public void MockAsyncDo(params object[] args)
{
if (backWorker.IsBusy) throw new Exception("Another
process is processing.");
/*
*
*/
bar.Style = ProgressBarStyle.Marquee;
backWorker.RunWorkerAsync(args);
}
public void ReportProgress(int val)
{
if (val > bar.Maximum)
{
val = bar.Maximum;
}
if (val < bar.Minimum)
{
val = bar.Minimum;
}
if (backWorker != null && backWorker.IsBusy)
{
backWorker.ReportProgress(val);
}
}
public void ResetBar()
{
bar.Value = 0;
}
#endregion
#region Priavete
private void InitComponet()
{
backWorker.WorkerReportsProgress = true;
backWorker.WorkerSupportsCancellation = false;
backWorker.DoWork += new
DoWorkEventHandler(backWorker_DoWork);
backWorker.ProgressChanged += new
ProgressChangedEventHandler(backWorker_ProgressChanged);
backWorker.RunWorkerCompleted += new
RunWorkerCompletedEventHandler(backWorker_RunWorkerCompleted);
}
void backWorker_RunWorkerCompleted(object sender,
RunWorkerCompletedEventArgs e)
{
if (e.Error != null)
{
throw e.Error;
}
bar.Value = bar.Maximum;
bar.Style = defaultStyle;
result = e.Result;
}
void backWorker_DoWork(object sender, DoWorkEventArgs e)
{
if (exec == null) throw new Exception("The property of
'ExecuteHandle' doesnot set method name,please check it first.");
try
{
e.Result = exec.DynamicInvoke(e.Argument);
}
catch (Exception ex)
{
throw ex;
}
}
void backWorker_ProgressChanged(object sender,
ProgressChangedEventArgs e)
{
bar.Value = e.ProgressPercentage;
}
#endregion
}
}
I write the class ,and want to use the class to update the
progressbar .But Now one problem occurred.,I cannot get the return
value:
for example:
ProgressController c = new
ProgressController(this.progressBar5);
c.ExecuteHandle = new Execute(SimpleComputeFibonacci);
c.AsyncDo(50);
MessageBox.Show(c.Result.ToString()); //null exception
occurred!
and think it because the thread and the delegate but i can not solute
it , Help me !
Thanks a lot !
- 5
- Missing a virtual directory but which one - MachineToApplication error.I am in the process of deploying my .NET 1.1 app from a test server over to
our cluster. I think I have everything set up correctly but when I start the
app, when I get past my login page, I get the following error message:
It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.
The problem is - I don't know what virtual directory it is looking for. I've
made sure I have all the same setting on the test machine as the final
machine but to no avail.
TIA - Jeff.
- 5
- Imbedding Image into EMailsI have a program that is used to send out HTML formatted emails. I have no
problems sending them out with images that are just links to an image stored
elsewhere on the Internet.. What I really want to do is imbed the image
into the email so that the recipient doesn't have to be connected to see it.
Is there an example out there somewhere? Thanks.
BTW, picking through other emails source code, it looks like this type of
email has some type of base 64 converted text at the end and the image tag
reference a unique key for each image.... I guess this is what I'm trying
to accomplish?
Thanks.
Rob T.
- 9
- Files missing from localization toolkitCan anyone send me these files:
ApplicationCultures.txt
Applications.txt
ControlTypes.txt
CultureProperties.txt
DictionaryProperties.txt
Elements.txt
Properties.txt
When I installed the Localization Toolkit these files were missing and
I have no stored procs in my SQL Server 7 database
Thanks in advance,
Gman
email***@***.com
- 10
- Outlook 10 Interop IssuesWhen trying to call this class to create an item in a public folder, I get
the following error:
Server execution failed
at VRInterop.Appointment.FindPublicFolder(String folderName) at
VRInterop.Appointment..ctor(String publicFolder, String subject, String body)
at VR.Confirm.ibtConfirm_Click(Object sender, ImageClickEventArgs e) in
c:\inetpub\wwwroot\vr\confirm.aspx.cs:line 162
VRInterop
The application calling this class is an ASP.Net app in C#. The server is
2000 Server and it has Office XP installed. There is a public folder
residing in Exchange 2000 and windows authentication is being used across the
board.
Any assistance is greatly appreciated.
public class Appointment
{
private Ol.MAPIFolder TaskFolder;
private Ol.Items tasks;
private string m_subject;
private string m_body;
public Appointment(string publicFolder, string subject, string body)
{
// Get a reference to the folder
TaskFolder = this.FindPublicFolder(publicFolder);
//Get a collection of the tasks
tasks = this.GetTasks();
//Set the subject and body
m_subject = subject;
m_body = body;
//Create the Appointment
this.Create();
}
private Ol.Items GetTasks()
{
/* GetTasks()
* This function returns a collection of task
* items from the specified folder object */
//Get the collection of items in the folder's default type
Ol.Items result = TaskFolder.Items;
return result;
}
public void Create()
{
/*The logic to creating the appointment(task) is simply
grabbing
* a reference to the collection of tasks within the folder and adding
* a new item, setting its properties and saving it. */
//Adding a task requires a cast. I honestly don't know why,
//but I got this from MSDN sample code.
Ol.TaskItem ti = (Ol.TaskItem)tasks.Add("IPM.Task");
ti.Subject = m_subject;
ti.Body = m_body;
ti.Save();
}
public Ol.MAPIFolder FindPublicFolder(string folderName)
{
/* FindPublicFolder()
* This function takes a string representing a folder
* and returns that object */
//Open the Outlook application
Ol._Application olApp = new Ol.ApplicationClass();
//Get a MAPI folder reference
Ol._NameSpace olNS = olApp.GetNamespace("MAPI");
//Iterate through folder hierarchy
//Get Upper Level folder set
Ol._Folders oFolders;
oFolders = olNS.Folders;
//Get the Public folder collection
Ol.MAPIFolder oPublicFolder = oFolders.Item("Public Folders");
oFolders = oPublicFolder.Folders;
//Get the All Public folders collection
Ol.MAPIFolder oAllPFolder = oFolders.Item("All Public Folders");
oFolders = oAllPFolder.Folders;
//Get the folder you're looking for
Ol.MAPIFolder oMyFolder = oFolders.Item(folderName);
return oMyFolder;
}
public override string ToString()
{
// Overridden from System.Object to produce something
// intelligent for the developer to see when needed.
string result = "Appointment Class\n";
result += "Current Folder: " + this.TaskFolder.Name.ToString() + "\n";
Ol.Items items = this.GetTasks();
result += "Item Count: " + items.Count.ToString();
return result;
}
}
Ryan Brady
email***@***.com
- 14
- SecurityException when calling DLL while using a UNC shareHello-
Platform:
- web server using IIS 6 connecting to UNC share on separate file
server
- Both servers are Windows 2003 with dotNetFramework 2.0
General:
- basic ASP.NET pages work fine in this situation
- However, if I'm calling a DLL (located in the bin directory), I get
the following error:
Error:
Security Exception
Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the
required permission please contact your system administrator or change
the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the
permission of type 'System.Web.AspNetHostingPermission, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.
_________
The Event Log shows the following:
Source: ASP.NET 2.0.50727.0
Event Id: 1310
Event code: 3008
Event message: A configuration error has occurred.
Event sequence: 11
Event occurrence: 5
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2908527797/Root/
forms-6-128231063458178510
Trust level: Full
Application Virtual Path: /forms
Application Path: \\servername\share\webapp\folder\
Process information:
Process ID: 2752
Process name: w3wp.exe
Account name: domain\IWAM_WEB
Exception information:
Exception type: ConfigurationErrorsException
Exception message: Request for the permission of type
'System.Web.AspNetHostingPermission, System, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (\\servername
\share\webapp\folder\web.config line 18)
Request information:
Request URL: http://www.domain.com/folder/filename.aspx
Request path: /folder/filename.aspx
User:
Is authenticated: False
Authentication Type:
Thread account name: domain\IWAM_WEB
_________
Appropriate code (and source of error) in web.config:
<httpHandlers>
<add verb="GET" path="filename.aspx"
type="WebControlCaptcha.CaptchaImageHandler, WebControlCaptcha"/>
</httpHandlers>
_________
The Event Log seems to confirm I have a full trust to the UNC on the
file server. However, I'm not using impersonation. (Is this needed?)
This application works fine in a single-server testing environment,
(with no UNC share). Your help is greatly appreciated.
Steve
- 14
- "Error Creating Control" and "Cast from String"I'm creating a custom date control. In appearance, it's just a
textbox and a button. It has three custom properties: CalDate,
CalDateType and Required. Required is just a boolean, and CalDate is
the contents of the textbox. CalDateType is an enum with four values:
CalDate, Today, Jan_01_1900, and This_Year_Start. If it's CalDate, it
leaves CalDate alone; otherwise, it sets CalDate to the chosen value.
I'm having two problems. When I put the control into a test page, I
get a rectangle that says "Error Creating Control". When I mouse over
the block, it says "Cast from String". It doesn't say what I'm
improperly casting from a string, and the control compiles just fine.
The other problem, which is more minor, is that the control I drag
into the page is given the name LLCal2. I've never seen a control
that implements INamingContainer start with 2.
Here is the code:
Imports System
Imports System.IO
Imports System.ComponentModel
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
<DefaultProperty("CalDate"), ToolboxData("<{0}:LLCal
runat=server></{0}:LLCal>")> _
Public Class LLCal
Inherits System.Web.UI.WebControls.WebControl
Implements INamingContainer
Private DateBox As TextBox
Public Enum CalDateTypes
CalDate
Today
This_Year_Start
Jan_01_1900
End Enum
Public Sub New(ByVal sCalDateType As String, ByVal bRequired As
Boolean)
DateBox = New TextBox
ViewState("CalDateType") = sCalDateType
ViewState("Required") = bRequired
Select Case ViewState("CalDateType")
Case CalDateTypes.Jan_01_1900.ToString
DateBox.Text = "01/01/1900"
Case CalDateTypes.This_Year_Start.ToString
DateBox.Text = "01/01/" & CType(Year(Now), String)
Case CalDateTypes.Today.ToString
DateBox.Text = Now.ToString("MM/dd/yyyy")
End Select
End Sub
Public Sub New()
DateBox = New TextBox
ViewState("CalDateType") = CalDateTypes.CalDate.ToString
ViewState("Required") = False
End Sub
Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
MyBase.OnPreRender(e)
RegisterScript()
End Sub
Protected Overridable Sub RegisterScript()
If Not Page.IsClientScriptBlockRegistered("LLCal_vbs") Then
Dim reader As New
System.IO.StreamReader(Me.GetType().Assembly.GetManifestResourceStream(Me.GetType(),
"LLCal.vbs"))
Dim script As String = "<script language='vbscript'
type='text/vbscript' >" + ControlChars.Cr + ControlChars.Lf + "<!--" +
ControlChars.Cr + ControlChars.Lf + reader.ReadToEnd() +
ControlChars.Cr + ControlChars.Lf + "//-->" + ControlChars.Cr +
ControlChars.Lf + "</script>"
Page.RegisterClientScriptBlock("LLCal_vbs", script)
End If
End Sub
<Bindable(True), Browsable(True), Category("Appearance"),
DefaultValue(""), Description("The date which appears in the
textbox"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
_
Public Property CalDate() As String
Get
EnsureChildControls()
Return ViewState("CalDate")
End Get
Set(ByVal Value As String)
If Not IsDate(Value) Then
EnsureChildControls()
DateBox.Text = ""
ViewState("CalDate") = ""
Else
EnsureChildControls()
DateBox.Text = CType(Value,
Date).ToString("MM/dd/yyyy")
ViewState("CalDate") = CType(Value,
Date).ToString("MM/dd/yyyy")
End If
End Set
End Property
<Bindable(True), Browsable(True), Category("Appearance"),
DefaultValue(CalDateTypes.CalDate), Description("Default Value Type
for DateBox"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
_
Public Property CalDateType() As CalDateTypes
Get
Return ViewState("CalDateType")
End Get
Set(ByVal Value As CalDateTypes)
ViewState("CalDateType") = Value.ToString
Select Case Value
Case CalDateTypes.Jan_01_1900
DateBox.Text = "01/01/1900"
Case CalDateTypes.This_Year_Start
DateBox.Text = "01/01/" & CType(Year(Now), String)
Case CalDateTypes.Today
DateBox.Text = Now.ToString("MM/dd/yyyy")
End Select
End Set
End Property
<Bindable(True), Browsable(True), Category("Misc"),
DefaultValue(False), Description("Whether the datebox must have a
value or not"), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
_
Public Property Required() As Boolean
Get
Return ViewState("Required")
End Get
Set(ByVal Value As Boolean)
ViewState("Required") = Value
End Set
End Property
Public Overrides ReadOnly Property Controls() As ControlCollection
Get
EnsureChildControls()
Return MyBase.Controls
End Get
End Property
Protected Overrides Sub CreateChildControls()
Controls.Clear()
Dim MyImage As System.Web.UI.WebControls.Image
Dim MyLabel As Label
Dim MyTable As Table
Dim MyRow As TableRow
Dim MyCell As TableCell
'<span style="font-size:6;background-color:silver;border:outset
2" onclick="showCalHTML(document.myform.reportdate2, 4)"
name=choosereportdate2 id=choosereportdate2
onmousedown="this.style.borderStyle='inset'"
onmouseup="this.style.borderStyle='outset'"><img src="LLCal.gif"
border="0"> </span>
' DateBox = New TextBox
DateBox.ID = "DateBox"
DateBox.Width = System.Web.UI.WebControls.Unit.Pixel(80)
DateBox.Attributes("RunAt") = "server"
DateBox.Attributes("OnBlur") = "me.value =
CorrectDate(me.value)"
DateBox.Attributes("OnFocus") = "me.select()"
DateBox.Text = ViewState("Value")
DateBox.EnableViewState = True
MyLabel = New Label
MyLabel.ID = "DateButton"
MyLabel.Attributes("style") = "font-size:6;
background-color:silver; border:outset 2"
MyLabel.Attributes("onmouseup") =
"me.style.borderStyle='Outset'"
MyLabel.Attributes("onmousedown") =
"me.style.borderStyle='Inset'"
MyLabel.Attributes("onclick") = "showCal(" & Me.ClientID &
"_DateBox" & ")"
MyLabel.Attributes("align") = "absMiddle"
MyImage = New System.Web.UI.WebControls.Image
If Not System.IO.File.Exists("C:\temp\LLCal.gif") Then
Dim LLCal_gif() As System.Byte
Dim myAssembly As System.Reflection.Assembly =
System.Reflection.Assembly.GetExecutingAssembly
Dim myStream As Stream =
myAssembly.GetManifestResourceStream("LLCal.LLCal.gif")
LLCal_gif = New System.Byte(myStream.Length) {}
myStream.Read(LLCal_gif, 0, CInt(myStream.Length))
Dim myTempFile As New FileStream("C:\temp\LLCal.gif",
FileMode.Create)
myTempFile.Write(LLCal_gif, 0, CInt(myStream.Length))
myTempFile.Close()
End If
MyImage.ImageUrl = "C:\temp\LLCal.gif"
MyLabel.Controls.Add(MyImage)
MyLabel.Controls.Add(New LiteralControl(" "))
MyTable = New Table
MyTable.BorderStyle = BorderStyle.None
MyTable.CellPadding = 0
MyTable.CellSpacing = 0
MyCell = New TableCell
MyCell.Attributes("style") = "padding:0"
MyCell.Controls.Add(DateBox)
MyRow = New TableRow
MyRow.Cells.Add(MyCell)
MyCell = New TableCell
MyCell.Attributes("style") = "padding:0"
MyCell.Controls.Add(MyLabel)
MyRow.Cells.Add(MyCell)
MyTable.Rows.Add(MyRow)
Controls.Add(MyTable)
End Sub
Protected Overrides Sub Render(ByVal output As
System.Web.UI.HtmlTextWriter)
Me.EnsureChildControls()
RenderContents(output)
End Sub
End Class
LLCal.gif, LLCal.bmp and LLCal.vbs are all in the assembly, so that I
can have the control be completely self-contained. Am I missing
something obvious here?
Thanks in advance,
Lisa
- 15
- header column span problemsi am trying to span header columns and am getting some problems. I
have 13 columns in my datagrid (1 template, 12 bound), and for some
reason, when i try to remove cells of index 11 or higher, it says the
index is not a valid index. Basically, I want the last 6 header
columns to span. Below is the code:
private void dgResults_ItemDataBound(object sender,
DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Header)
{
DataGridItem dgItem;
TableCellCollection tcells;
TableCell fcell;
TableCell scell;
dgItem = e.Item;
tcells = e.Item.Cells;
fcell = e.Item.Cells[0];
fcell.Text = "";
fcell = e.Item.Cells[1];
fcell.Text = "";
fcell = e.Item.Cells[2];
fcell.Text = "";
fcell = e.Item.Cells[3];
fcell.Text = "";
fcell = e.Item.Cells[4];
fcell.Text = "";
fcell = e.Item.Cells[5];
fcell.Text = "";
fcell = e.Item.Cells[6];
fcell.Text = "";
fcell = e.Item.Cells[7];
fcell.Text = "My Question goes here";
fcell.ColumnSpan = 6;
fcell.BackColor = System.Drawing.Color.Black;
scell = e.Item.Cells[8];
dgItem.Cells.Remove(scell);
scell = e.Item.Cells[9];
dgItem.Cells.Remove(scell);
scell = e.Item.Cells[10];
dgItem.Cells.Remove(scell);
scell = e.Item.Cells[11];
dgItem.Cells.Remove(scell);
scell = e.Item.Cells[12];
dgItem.Cells.Remove(scell);
}
}
it bombs out on the scell = e.Item.Cells[11]; line
Any ideas why?
- 15
- User Control in IE (authentication)?Hi,
I have a "little" problem with authentication from user control (written in
.NET c#) that
is displayed in HTML page using Internet Explorer. Its possible using
<object classid=....> tag.
Lets say i have logged in as user A to my computer.
Then i launch my browser (IE) and open website that requires authentication
(Windows Integrated).
So I log in as user B. The page that is displayed for me contains the
user control. This user control is run under user A privileges.
So my question:
IS THERE ANY solution somehow to get the credentials of the user B?
I want to connect to webservices located on the same website, and pass
the same credentials.
Thanks for any advice.
---
Mantas Miliukas
- 16
- Web Config conflict?I have 2 ASP.NET (C#) applications (A and B) running on the same
server (IIS6, but the problems is also present in IIS5).
Each application has its own Web.Config file. The only difference
between the web config files is the following
<system.web>
<httpHandlers>
<add verb="GET" path="cachedimageservice.axd"
type="MsdnMag.CachedImageService,DynamicImage" />
</httpHandlers>
</system.web>
When I run application A, which does not contain the above handler, I
get an error: "File or assembly name DynamicImage, or one of its
dependencies, was not found."
It is as if the handler declaration is machine wide and not limited to
application B. What is going on?
Finally, if I add the DynamicImage.dll to application A's bin
directory the error goes away... Application A does NOT make use of
this dll
Any clues?
- 16
- Canceling Page.Load eventI have an aspx page with this code behind
Public Class WebForm1
Inherits Class1
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Derived
Return
End Sub
End Class
And a Class
Public Class Class1
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Base
Return
End Sub
End Class
When asp page is loaded base event fires first. Then derived class event
fires.
How can I conditionally prevent derived class Page_Load event from firing?
Thanks.
--
Regards.
_____________________________________
AT
- 16
- Reading A Text File From A Remote ServerWe currently run our web site in php and are now converting it to asp.net to
match the rest of our business that is .net based. I have tried using the
following code layout to open the file I require but get an illigal
character exception when I try and open the file.
Dim sFileName As String =
"https://www.breathecall.com/wholesale/api/api.php?partnerid=9aa999aa99999999aa99aaaa99a9a9aa&wid=99990&action=0&account=99999"
Dim oFileStream As New IO.FileStream(sFileName, IO.FileMode.Open)
Dim oDataFile As New IO.StreamReader(oFileStream)
The file name works fine when in php. Are there specific characters that
cannot be used in a path name within the dotnet framework? If so is there a
way to get round the problem?
Thanks in advance
|
| Author |
Message |
Craig Hunt

|
Posted: 2005-10-19 4:51:38 |
Top |
dotnet-framework-aspnet, Visual Studio HTML IDE
I posted this in another newsgroup, so please forgive me if you've already
seen it.
---
Am I missing something here?
Quite frequently, I'll write an aspx document taking care to format the HTML
so that I and others on my team can read it. <sarcasm>We kind of like to
know what's going on when we come back to the document later.</sarcasm> In
any case, the editor, when switching from HTML view to the designer view
will do crazy things like completely remove all of the formatting in the
HTML as well as remove style and other attributes, and it will even remove
the quotes from the attributes it leaves in place.
I've checked the options for my IDE, and I've turned off HTML validation and
unchecked the Apply Automatic Formatting boxes. Is there another setting I
need to check to get the IDE to leave my HTML as I enter it. I'm really
getting tired of having to fix the IDE's screw ups because it REALLY doesn't
know how to write HTML.
TIA for any assistance.
Craig
|
| |
|
| |
 |
Juan T. Llibre

|
Posted: 2005-10-19 5:14:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
As others have pointed out, this is a WKP (well-known problem) with
VS.NET 2002 and VS.NET 2003, which has been fixed in VS.NET 2005.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espa駉l : http://asp.net.do/foros/
======================================
"Craig Hunt" <email***@***.com> wrote in message
news:ufd5f.199613$email***@***.com...
>I posted this in another newsgroup, so please forgive me if you've already
> seen it.
> ---
>
> Am I missing something here?
>
> Quite frequently, I'll write an aspx document taking care to format the HTML
> so that I and others on my team can read it. <sarcasm>We kind of like to
> know what's going on when we come back to the document later.</sarcasm> In
> any case, the editor, when switching from HTML view to the designer view
> will do crazy things like completely remove all of the formatting in the
> HTML as well as remove style and other attributes, and it will even remove
> the quotes from the attributes it leaves in place.
>
> I've checked the options for my IDE, and I've turned off HTML validation and
> unchecked the Apply Automatic Formatting boxes. Is there another setting I
> need to check to get the IDE to leave my HTML as I enter it. I'm really
> getting tired of having to fix the IDE's screw ups because it REALLY doesn't
> know how to write HTML.
>
> TIA for any assistance.
>
> Craig
>
>
|
| |
|
| |
 |
Craig Hunt

|
Posted: 2005-10-19 5:24:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
My apologies to the group.
I found the answer to my question about five seconds after I hit send.
Too late to retrieve the message at that point.
Thanks for the reply.
Cheers!
"Juan T. Llibre" <email***@***.com> wrote in message
news:email***@***.com...
> As others have pointed out, this is a WKP (well-known problem) with
> VS.NET 2002 and VS.NET 2003, which has been fixed in VS.NET 2005.
|
| |
|
| |
 |
Ken Dopierala Jr.

|
Posted: 2005-10-19 5:27:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
Hi Craig,
It is a known problem. To get around the missing quotes thing don't switch
between Design & HTML views while your app is running in the IDE. If you do
and your quotes go away then when your app is stopped make a small change in
HTML view then switch to Design view and back to HTML view and everything
should have quotes again. Annoying workaround, but it has saved me some
time. Good luck! Ken.
--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.
"Craig Hunt" <email***@***.com> wrote in message
news:ufd5f.199613$email***@***.com...
> I posted this in another newsgroup, so please forgive me if you've already
> seen it.
> ---
>
> Am I missing something here?
>
> Quite frequently, I'll write an aspx document taking care to format the
HTML
> so that I and others on my team can read it. <sarcasm>We kind of like to
> know what's going on when we come back to the document later.</sarcasm>
In
> any case, the editor, when switching from HTML view to the designer view
> will do crazy things like completely remove all of the formatting in the
> HTML as well as remove style and other attributes, and it will even remove
> the quotes from the attributes it leaves in place.
>
> I've checked the options for my IDE, and I've turned off HTML validation
and
> unchecked the Apply Automatic Formatting boxes. Is there another setting
I
> need to check to get the IDE to leave my HTML as I enter it. I'm really
> getting tired of having to fix the IDE's screw ups because it REALLY
doesn't
> know how to write HTML.
>
> TIA for any assistance.
>
> Craig
>
>
|
| |
|
| |
 |
QWFydGhp

|
Posted: 2005-10-19 5:35:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
Unfortunately with VS 2003, you need to live with this. This is corrected in
VS 2005
--
Aarthi R S
"Craig Hunt" wrote:
> I posted this in another newsgroup, so please forgive me if you've already
> seen it.
> ---
>
> Am I missing something here?
>
> Quite frequently, I'll write an aspx document taking care to format the HTML
> so that I and others on my team can read it. <sarcasm>We kind of like to
> know what's going on when we come back to the document later.</sarcasm> In
> any case, the editor, when switching from HTML view to the designer view
> will do crazy things like completely remove all of the formatting in the
> HTML as well as remove style and other attributes, and it will even remove
> the quotes from the attributes it leaves in place.
>
> I've checked the options for my IDE, and I've turned off HTML validation and
> unchecked the Apply Automatic Formatting boxes. Is there another setting I
> need to check to get the IDE to leave my HTML as I enter it. I'm really
> getting tired of having to fix the IDE's screw ups because it REALLY doesn't
> know how to write HTML.
>
> TIA for any assistance.
>
> Craig
>
>
>
|
| |
|
| |
 |
poppybush

|
Posted: 2005-10-19 5:47:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
In a perfect world VS's HTML view would be Notepad with intellisense.
|
| |
|
| |
 |
Juan T. Llibre

|
Posted: 2005-10-19 6:22:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
And color-coding, and collapsing regions, and...and...and.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espa駉l : http://asp.net.do/foros/
======================================
<email***@***.com> wrote in message
news:email***@***.com...
> In a perfect world VS's HTML view would be Notepad with intellisense.
|
| |
|
| |
 |
poppybush

|
Posted: 2005-10-19 6:40:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
How customizable is the HTML editor in 2005 Juan?
|
| |
|
| |
 |
Juan T. Llibre

|
Posted: 2005-10-19 6:57:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
Quite a bit, poppybush.
Check out the possibilities in "Tools", "Options", "Text HTML Editor",
and see all the stuff that you can customize in "Tag Specific Options".
Also, if you check "Show all settings", after "Tools", "Options",
you can scroll down to "Text Editor" and the "HTML",
for a bundle of additional settings you can customize.
You can even customize language-specific stuff.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Espa駉l : http://asp.net.do/foros/
======================================
<email***@***.com> wrote in message
news:email***@***.com...
> How customizable is the HTML editor in 2005 Juan?
|
| |
|
| |
 |
Rhywun

|
Posted: 2005-11-16 1:33:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
The tag-specific formatting in VS2005 still needs a little work. End
tags wind up all clustered on one line in the same annoying manner that
VS2003 provided:
<ol>
<li>one</li>
<li>two</li></ol>
Even if you tell it to insert a line-break before the ending </ol> tag,
it doesn't happen... unless there is a space before the end tag. But
who is going to remember to separate all their tags with spaces?
|
| |
|
| |
 |
Alan Silver

|
Posted: 2005-11-22 23:13:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
>The tag-specific formatting in VS2005 still needs a little work. End
>tags wind up all clustered on one line in the same annoying manner that
>VS2003 provided:
<snip>
And have you discovered that setting the indent for HTML to zero still
gives indented HTML?
And why does *every* single tag have a separate closing tag? For
example, when you add a Literal, you get...
<asp:Literal ID="" Runat="Server"></asp:Literal>
Why would I want that? I can't think of a single good reason to separate
out the closing tag. Sure, some controls are very likely to want it, but
many aren't. You don't seem to have the choice.
Close, but still so far ;-(
--
Alan Silver
(anything added below this line is nothing to do with me)
|
| |
|
| |
 |
PL

|
Posted: 2005-11-22 23:21:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
> And why does *every* single tag have a separate closing tag? For example, when you add a Literal, you get...
What a lot of wining, does an extremely unimportant thing like that really bother you ?
> Close, but still so far ;-(
How do you ever get past one single day of programming ? I think you better
take a look at you life and decide if you want to continue with programming
if a small thing like that bothers you that much.
PL.
|
| |
|
| |
 |
Juan T. Llibre

|
Posted: 2005-11-22 23:33:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
Hi, Alan.
That behavior is really a disgrace, since the default code
for the Literal tag is without the separate closing tag :
http://beta.asp.net/QUICKSTART/util/srcview.aspx?path=~/aspnet/samples/ctrlref/standard/Literal/Literal1.src
To make this a bit more bearable, did you know that
you can add custom text snippets to VS 2005's Toolbox ?
Just write your tag, formatted the way you like it :
<asp:Literal ID="" Runat="Server"></asp:Literal>
and drag it into the Toolbox.
When you drag that Text snippet into any file,
it will be inserted exactly as you wrote it.
I agree, the Literal, and other controls, should have a closing tag in its
own line, instead of a closing tag separated from the code, but using
the text code snippets help alleviate that pain.
Have you bugged that behavior at the Feedback Center ?
That's the best way to get VS features modified.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espa駉l : http://asp.net.do/foros/
======================================
"Alan Silver" <email***@***.com> wrote in message
news:email***@***.com...
> >The tag-specific formatting in VS2005 still needs a little work. End
>>tags wind up all clustered on one line in the same annoying manner that
>>VS2003 provided:
> <snip>
>
> And have you discovered that setting the indent for HTML to zero still gives indented
> HTML?
>
> And why does *every* single tag have a separate closing tag? For example, when you add a
> Literal, you get...
>
> <asp:Literal ID="" Runat="Server"></asp:Literal>
>
> Why would I want that? I can't think of a single good reason to separate out the closing
> tag. Sure, some controls are very likely to want it, but many aren't. You don't seem to
> have the choice.
>
> Close, but still so far ;-(
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
|
| |
|
| |
 |
Alan Silver

|
Posted: 2005-11-23 0:41:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
>Hi, Alan.
>
>That behavior is really a disgrace, since the default code
>for the Literal tag is without the separate closing tag :
>
>http://beta.asp.net/QUICKSTART/util/srcview.aspx?path=~/aspnet/samples/c
>trlref/standard/Literal/Literal1.src
Oh well, at least I'm not alone!!
>To make this a bit more bearable, did you know that
>you can add custom text snippets to VS 2005's Toolbox ?
<snip>
I knew in theory, but haven't explored far enough to do it myself. I
find it a bit of a shame that I have to do this myself, but at least
once it's done, I can have it how I want it.
>Have you bugged that behavior at the Feedback Center ?
>That's the best way to get VS features modified.
No I haven't. Where do you go to log such things?
Ta ra
>Juan T. Llibre, ASP.NET MVP
>ASP.NET FAQ : http://asp.net.do/faq/
>ASPNETFAQ.COM : http://www.aspnetfaq.com/
>Foros de ASP.NET en Espa駉l : http://asp.net.do/foros/
>======================================
>"Alan Silver" <email***@***.com> wrote in message
>news:email***@***.com...
>> >The tag-specific formatting in VS2005 still needs a little work. End
>>>tags wind up all clustered on one line in the same annoying manner that
>>>VS2003 provided:
>> <snip>
>>
>> And have you discovered that setting the indent for HTML to zero
>>still gives indented
>> HTML?
>>
>> And why does *every* single tag have a separate closing tag? For
>>example, when you add a
>> Literal, you get...
>>
>> <asp:Literal ID="" Runat="Server"></asp:Literal>
>>
>> Why would I want that? I can't think of a single good reason to
>>separate out the closing
>> tag. Sure, some controls are very likely to want it, but many aren't.
>>You don't seem to
>> have the choice.
>>
>> Close, but still so far ;-(
>>
>> --
>> Alan Silver
>> (anything added below this line is nothing to do with me)
>
>
--
Alan Silver
(anything added below this line is nothing to do with me)
|
| |
|
| |
 |
Juan T. Llibre

|
Posted: 2005-11-23 1:02:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
re:
>at least once it's done, I can have it how I want it.
Yeah.It should be default behavior, but at least we can do it.
re:
> Where do you go to log such things?
http://lab.msdn.microsoft.com/productfeedback/
You can make suggestions or file bug reports.
You'll need a Passport account to be able to post there.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espa駉l : http://asp.net.do/foros/
======================================
"Alan Silver" <email***@***.com> wrote in message
news:Xyf$email***@***.com...
> >Hi, Alan.
>>
>>That behavior is really a disgrace, since the default code
>>for the Literal tag is without the separate closing tag :
>>
>> http://beta.asp.net/QUICKSTART/util/srcview.aspx?path=~/aspnet/samples/ctrlref/standard/Literal/Literal1.src
>
> Oh well, at least I'm not alone!!
>
>>To make this a bit more bearable, did you know that
>>you can add custom text snippets to VS 2005's Toolbox ?
> <snip>
>
> I knew in theory, but haven't explored far enough to do it myself. I find it a bit of a
> shame that I have to do this myself, but at least once it's done, I can have it how I
> want it.
>
>>Have you bugged that behavior at the Feedback Center ?
>>That's the best way to get VS features modified.
>
> No I haven't. Where do you go to log such things?
>>======================================
>>"Alan Silver" <email***@***.com> wrote in message
>>news:email***@***.com...
>>> >The tag-specific formatting in VS2005 still needs a little work. End
>>>>tags wind up all clustered on one line in the same annoying manner that
>>>>VS2003 provided:
>>> <snip>
>>>
>>> And have you discovered that setting the indent for HTML to zero still gives indented
>>> HTML?
>>>
>>> And why does *every* single tag have a separate closing tag? For example, when you add
>>> a
>>> Literal, you get...
>>>
>>> <asp:Literal ID="" Runat="Server"></asp:Literal>
>>>
>>> Why would I want that? I can't think of a single good reason to separate out the
>>> closing
>>> tag. Sure, some controls are very likely to want it, but many aren't. You don't seem
>>> to
>>> have the choice.
>>>
>>> Close, but still so far ;-(
|
| |
|
| |
 |
Alan Silver

|
Posted: 2005-11-23 1:55:00 |
Top |
dotnet-framework-aspnet >> Visual Studio HTML IDE
>> Where do you go to log such things?
>
>http://lab.msdn.microsoft.com/productfeedback/
>
>You can make suggestions or file bug reports. You'll need a Passport
>account to be able to post there.
Thanks, I've logged two things there, this one and the fact that you
don't seem to be able to turn off HTML indenting. Again, not
earth-shattering, but annoying to those who like neat code.
Thanks for the link. Ta ra
--
Alan Silver
(anything added below this line is nothing to do with me)
|
| |
|
| |
 |
| |
 |
Index ‹ dotnet-framework-aspnet |
- Next
- 1
- Textbox Width Issue (Rendered differently for different browsers)Using ASP.NET 1.1
I have an <asp:TextBox... for which I set the width property --- "width=30".
The textbox is being rendered to the browser like this:
<input name="someName" type="text" maxlength="3" id="someID"
style="width:30px;" />
Notice the [Width=30] gets rendered as [style="width:30px;"]. This causes
the textbox to be 30 pixels wide, at least in IE and Opera.
I have discovered in testing that the [style="width:30px;"] part is *omitted
completely* from the rendered HTML when the page is requested by FireFox or
Netscape Navigator (6.2) - so the textbox (really <input... />) gets some
default width rather than being set to 30 pixels wide.
What can I do to set the width the same for FireFox and NN (same as for IE)?
Thanks!
- 2
- TTLB For aspx pageWould I be correct in thinking that the TTLB metric returned by ACT when
stress testing an aspx page is the total time for the entire execution and
delivery of the page (including all the CLR processing etc)?
Regards,
Tim.
- 3
- What editor, what environment to program in?hi
been using Editplus for JScript/MS Access/ASP for 4 years now while asp
programming. Would like to try some other environment now while migrating to
C#/.Net
Some environments I find interesting are
* Aspexpress
text editor so I get full control of my code. Might be too simple?
* Visual studio
for web page programming... I'd think it's like driving a Benz truck to and
from work - fancy but too much!
* SharpDevelop
seems like the coolest - open source (free) project having many features
from VS and even more. Looks very cool.
(http://www.icsharpcode.net/OpenSource/SD)
Can you guys please comment, what are you using, what's your preference?
Thx
- 4
- [NEWBIE] How to add a custom control to the toolbox!Hey
In visual studio 2005 I've created a custom control (well I just downloaded
the source code of this control from the Internet, it's a google map
control).
I have no .dll file for this control, but I have it's asp.net source code
I wonder how can I add this control to the toolbox in vs2005, so I easly can
drop the control onto a webpage and use it???
Jeff
- 5
- OnMouseOver Event For Tree's Node?Hi.
Does anybody know how to do this?
I need to do an onmouseover for the node, not the parent.
how do i add attributes to sub nodes???
thanks.
- 6
- Still Trying to Find the Best Way to Serve DocumentsGreetings!
I am still trying to determine the best way to implement a Web site that
contains many documents that visitors can read. Most of the suggestions I've
been given indicate that I should store the documents in a database but then
cache them to pages.
Unfortunately, while an experienced programmer, I've very new to ASP.NET and
the very brief descriptions I've been given how to do this, I just don't
understand.
I would think this is a common task yet I've done a lot of searching the Web
and came up empty. Is there anyone who can provide me with some more
specific information on the best way to implement this?
Thanks!
--
Jonathan Wood
SoftCircuits
http://www.softcircuits.com
- 7
- Loading an image webcontrol directly without saving file to serverMy question is similar to one someone posted a few months back, but I don't
see any replies.
Basically I want to be able to have users upload photos and save them in a
database (as byte data) and be able to load them to an image webcontrol, but
system.web.ui.webcontrols.image only seems to have a control to load the
image from a URL.
There's no way to load this directly without saving the image as a file and
then using "Image1.ImageUrl = ..."?
Seems a little silly, am I missing something obvious here?
----- Original Message -----
From: "byrd48" <email***@***.com>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Wednesday, July 05, 2006 9:02 PM
Subject: system.drawing.image to system.web.ui.webcontrols.image
> Hi,
> I have a method that creates a system.drawing.image behind the scenes.
> I would like to load this image to a web page as a control, as in
> td.controls.add(). I know I can save this generated image to the
> server as a jpg, then load it as a webcontrols image, but I would
> rather skip that step and load it without saving.
> What do you suggest?
> Thanks in advance.
>
> Jon
>
- 8
- Open web page in new windowI am creating a web application using C#. I have a login page that is
used authenticate the user and redirect them to another web page called
Run.aspx that runs an executable that takes their username as a
parameter. Currently I am using Response.Redirect(Run.aspx) to take
the authenticated user to the page.
Session ["UserName"] = userName.Text;
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(userName.Text,
false);
Response.Redirect("Run.aspx");
Now I need to take the authenticated user to the page by opening a new
window. I have read most of the post concerning this subject and tried
the suggestions, but I can't open a new window. I have tried
something like this:
string script = "<script language='javascript'>window.open('Run.aspx',
'_blank');</script>";
Page.RegisterStartupScript("script", script);
and others, but nothing seems to work. I would really appreciate any
help, thanks.
- 9
- Pivot tableI have table (or tables) with data in SQL, which I would like to connect to
pivot table and show table in asp.net page.
Is there some example? I have 2 books about asp.net but there is nothing
about pivot tables.
Thank you,
Simon
- 10
- Northwind based ASP.NET DemoHere is a site you might want to look at:
http://www.quickadmin.net/northwind.aspx
-Chris
--------------------
>From: email***@***.com (MeDhanush)
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Subject: Northwind based ASP.NET Demo
>Date: 24 Mar 2004 17:46:07 -0800
>Organization: http://groups.google.com
>Lines: 7
>Message-ID: <email***@***.com>
>NNTP-Posting-Host: 68.84.232.163
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1080179167 5166 127.0.0.1 (25 Mar 2004
01:46:07 GMT)
>X-Complaints-To: email***@***.com
>NNTP-Posting-Date: Thu, 25 Mar 2004 01:46:07 +0000 (UTC)
>Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news.glorb.com!postnews2.google.com!not-for-mail
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:221060
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
>Hi All,
>
>Can sb pl recommend me any good ASP.NET demo app that is based on the
>Northwind database ?
>
>Thanks
>MeDhanush
>
- 11
- Formview Question about Dates and FormattingI have a formview control in my project (VS2005/ASP.NET 2.0) and I have one
field that is a date. I have it formatting correctly as a short date
(MM/dd/yyyy) but when I click the edit link to edit the record, it is
showing the long date/time format. How do I force the thing to only show
short date format while in edit mode also?
Thanks in advance!
- 12
- How to set CopyLocal for the references in ASP.net 2.0 project?Use asp.net 2.0 project, without "WebProject 2003" plugin.
So, all references are in the web.config file
How can I set "CopyLocal" for the references in web.config?
can't find attributes for that in <assemblies> tag
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangel
- 13
- Server Error in '/' Application - NoviceHi there,
I am trying to call a C# web service from an aspx page, I have the asmx
file, a user control file ascx and the aspx file. I have verified that the
web service is returning correct values from the service, however when I try
to load the aspx page it falls over in a cruumbling heap! Could someone tell
me what I am doing wrong as I know that I am close to getting this thing
working.
Thanks in advance for your answer
Sean
Error messages and source code below ------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'Service1' could
not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 7: private void Button1_Click(object sender, System.EventArgs e)
Line 8: {
Line 9: Service1 currSvc = new Service1();
Line 10: double dRate = currSvc.ConversionRate(currFrom.CurrencyCode,
currTo.CurrencyCode);
Line 11: if (dRate < 0)
Source File: e:\inetpub\wwwroot\Currency1\currconv.aspx Line: 9
!--- aspx page
private void Button1_Click(object sender, System.EventArgs e)
{
Service1 currSvc = new Service1();
double dRate = currSvc.ConversionRate(currFrom.CurrencyCode,
currTo.CurrencyCode);
if (dRate < 0)
lblConversion.Text = "Error Occured";
else
lblConversion.Text = "" + txtAmount.Text + " " + currFrom.CurrencyCode +
"(s) =" + Convert.ToString(dRate * Convert.ToDouble(txtAmount.Text)) + " " +
currTo.CurrencyCode;
}
!--------------- web service
<%@ WebService Language="c#" Class="CurrencyNS.Service1" %>
using System;
using System.Web;
using System.Web.Services;
using System.Net;
using System.IO;
using System.Text;
namespace CurrencyNS
{
[WebService]
public class Service1 : System.Web.Services.WebService
{
[WebMethod]
public double ConversionRate(string From, string To)
{
HttpWebRequest req;
HttpWebResponse res;
StreamReader sr;
string strResult;
string fullpath;
char[] separator = {','} ;
double dRate=-1;
fullpath = "http://finance.yahoo.com/d/quotes.csv?s=" + From + To +
"=X&f=sl1d1t1c1ohgv&e=.csv";
try
{
req = (HttpWebRequest) WebRequest.Create(fullpath);
res = (HttpWebResponse) req.GetResponse();
sr = new StreamReader(res.GetResponseStream(), Encoding.ASCII);
strResult = sr.ReadLine();
sr.Close();
string[] temp = strResult.Split(separator) ;
if(temp.Length >1)
{
string strRate = temp[1];
//We only show the relevant portions .
dRate = Convert.ToDouble(strRate);
}
}
catch(Exception )
{
dRate = -1;
}
return dRate;
}
}
}
- 14
- IFrame Page_Load multiple timeHello
I have a default.aspx page with which has an iframe.
In the code-behind of the default.aspx page it loads the 'src'
attribute of the iframe.
The iframe loads another aspx page, but when it loads the Page_Load
method is called multiple times. In some situations the page is
called twice and in others it is called 4 times.
any ideas what might be going on here.
Thanks,
Matt
- 15
- ASP.NET webservice & Javascript
Can Javascript code catch an exception thrown in an ASP.NET webservice?
(Using XMLHTTPRequest object to send the SOAP message to the webservice.)
If so, what't the Javascript syntax please?
TIA
|
|
|