|
When I said that it works, I meant that it doesn't blow up. However, the stuff in App_Code is no longer accessible from the rest of the project. I think I might do better to just switch over to a web application project or something.
This makes me want to switch over to ROR instead of bothering with C#, as it seems that I'm spending more time trying to make Visual Studio play nice than I am actually coding. It's hitting the point that it would be an improvement for me to just develop using a terminal and a text editor, which is what I use in Ruby.
Visual Studio 2005 reminds me of Rain Man a little more every time I use it. Sure, it can do impressive stuff that others can't do without a lot more work, but it has an apoplectic meltdown if you don't buy your underwear at Target.
|
|
|
|
|
Can Crystal Report show dynamic picture?
Is anyone know?
thank you
|
|
|
|
|
Use a typed DataSet, put the graphic in the DataSet and use the DataSet as DataSource for the Crystal Report.
So we can make it as Dynamic.
Hope this will help you.
Regards,
Satips.
|
|
|
|
|
Hi, I've found the function below when I was searching for ways to prevent SQL Injection. Basically it is supposed to remove the words select, drop, inser, delete, and other characters that can affect your database. I'm new to VB.NET and ASP.NET so please bear with me.
function killChars(strWords)
dim badChars
dim newChars
badChars = array("select", "drop", ";", "--", "insert", "delete", "xp_")
newChars = strWords
for i = 0 to uBound(badChars)
newChars = replace(newChars, badChars(i), "")
next
killChars = newChars
end function
I get the error message "array is a type and can not be used as an expression". I also noticed that the datatype for the variables badChar and newChars were not specified and VS2003 says the variable "i" in the for loop was not declared. I have seen vb.net For loops used the way its being used in the function above without generating errors. Please help clarify, thank you in advance for your help.
|
|
|
|
|
If you want to prevent SQL injection attacks then don't accept SQL statements period, use store procedures or parameterized queries.
only two letters away from being an asset
|
|
|
|
|
Use Stored Procedure.
Then you will not get these error.
Regards,
Satips.
|
|
|
|
|
Gee, wish I had said that...oh I did, 1 hour 20 minutes ago.
only two letters away from being an asset
|
|
|
|
|
LOL - yeah, I sometimes give an answer where the correct answer has been given, but I feel I can expand on it. Some people seem to just reiterate answers tho, some posts get 6 or 7 answers, all the same, hours apart. Go figure
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Helloo Iam delpoy my web application(asp.net 2.0)
and gives following error
is it possible that bcz the server dont support .net 2.0
???????
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load the assembly 'WebSite8_deploy'. Make sure that it is compiled before accessing the page.
Source Error:
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="Default3, WebSite8_deploy" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File:-----\test\Default3.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2379; ASP.NET Version:1.1.4322.2379 <<<<------------------- look here
aj123
|
|
|
|
|
Well - does the server have .NET 2.0 installed? Would seem like an obvious requirement to me....
|
|
|
|
|
I have ported my Visual Studio2003/asp.net 1.1 web application on to Visual Studio 2005/asp.net2.0 platform. One page of this web application behaves strangely. On the home page of the application there is a head control and footer control. This user controls have links which allows users to go to various pages upon clicking. All except one link somehow behaves differently. This link however upon clicking opens up correctly the page but on clicking any button or even doing selected item change on drop down box on the page displays error like “Internet Explorer cannot display the webpage” and under what you can try section it lists Diagnose Connection Problem and More Information. If I try to browse this site on development machine I get an error “The page can not be displayed” and “cannot find Server or DNS Error”. The server on which this web application is deployed is Virtual Machine having Windows 2003 sever with IIS 6.0 and asp.net 2.0 and .Net Framework 2.0.
Can any one please shed light how to solve this problem?
I would like to thank you in advance for your help.
Bharat Gadhia
|
|
|
|
|
The links point to the wrong URL. Check what url is in the browser address bar when you get these errors.
|
|
|
|
|
Thank you for your reply.
This error also occurs even while changing selection in drop down box.The same link works fine in Visual Studio 2003/asp.net 1.1 enviornment.
Bharat Gadhia
|
|
|
|
|
I have code that calls a report (report service 2005) that I have to put into a web service and then stream to a client app (vb - asp.net). The code that runs the report, gets and displays the report fine if I place it on a regular aspx page but I can't figure out how to put it in a web service and stream it to a client for consumption.
The following code will display the report:
Response.ClearContent()
Response.AppendHeader("content-length", result.Length.ToString())
Response.ContentType = "application/PDF"
Response.BinaryWrite(result)
Response.Flush()
Response.Close()
and this will write it to a file:
Dim stream As System.IO.FileStream = System.IO.File.OpenWrite(fileName)
stream.Write(result, 0, result.Length)
But how to I do this as a web method?????
Full code is below:
---------------------------------------------------------------------------
Imports System.IO
Imports System.Web
Imports System.Net
Imports System.Web.Services
Imports System.Web.Services.Protocols
<webservice(namespace:="ggmitg.servicesbus")> _
<webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)> _
<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Public Class ServicesBus
Inherits System.Web.Services.WebService
<webmethod()> _
Public Function GetReport() As String
Dim rs As RptSrv2005.ReportingService2005
Dim rsExec As RptExec2005.ReportExecutionService
'create new proxy to the web service
rs = New RptSrv2005.ReportingService2005()
rsExec = New RptExec2005.ReportExecutionService()
'authenticate to the web service using windows credentials
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials
'assign the url of the web service
rs.Url = "http://192.168.248.12/ReportServer/ReportService2005.asmx"
rsExec.Url = "http://192.168.248.12/ReportServer/ReportExecution2005.asmx"
'prepare render arguments
Dim result As Byte() = Nothing
'Dim reportPath As String = "/AP Recovery Audits Reports/VendorsStatus "
Dim format As String = "PDF"
Dim historyID As String = Nothing
Dim devInfo As String = "<deviceinfo><toolbar>False"
Dim extension As String = Nothing
Dim encoding As String = Nothing
Dim mimeType As String = Nothing
Dim warnings As RptExec2005.Warning() = Nothing
Dim streamIDs As String() = Nothing
'define variables needed for GetParameters() method
Dim reportName As String = "/AP Recovery Audits Reports/VendorsStatus"
Dim forRendering As Boolean = False
Dim values As RptSrv2005.ParameterValue() = Nothing
Dim credentials As RptSrv2005.DataSourceCredentials() = Nothing
Dim parameters As RptSrv2005.ReportParameter() = Nothing
'other parameters
'Dim fileName As String = "c:\testreport.pdf"
'Dim fileName As String = "c:\test.data" 'file to hold binary data
Try
'see if any parameters are needed
parameters = rs.GetReportParameters(reportName, historyID, forRendering, values, credentials)
'load selected report
Dim execInfo As New RptExec2005.ExecutionInfo
execInfo = rsExec.LoadReport(reportName, historyID)
'set the parameters needed for the report.
Dim params(0) As RptExec2005.ParameterValue ' = New RptExec2005.ParameterValue
params(0) = New RptExec2005.ParameterValue
params(0).Name = parameters(0).Name
params(0).Value = "140"
rsExec.SetExecutionParameters(params, "en-us")
result = rsExec.Render(format, devInfo, extension, encoding, mimeType, warnings, streamIDs)
'output the file
'Response.ClearContent()
'Response.AppendHeader("content-length", result.Length.ToString())
'Response.ContentType = "application/PDF"
'Response.BinaryWrite(result)
'Response.Flush()
'Response.Close()
'create a file stream and write the report to it
'Dim stream As System.IO.FileStream = System.IO.File.OpenWrite(fileName)
'stream.Write(result, 0, result.Length)
???????????????????
How do I stream output to a consumer app
???????????????????
Catch ex As Exception
'Response.Write(ex.Message)
End Try
'Return "Hello World"
End Function
End Class
|
|
|
|
|
Hello, I'm new to ASP.NET. I 've ben a C# programmer for about a year, but I'm just touching on the realms of web development.
Anyhow... I'm having a problem. Everytime I try to compile and run my page, I get the following message: "CS0117: 'ASP.index_aspx' does not contain a definition for 'MyScript'"
This is the code on my page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Page Language="C#" %>
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
<link rel="stylesheet" type="text/css" href="default.css" />
<script type="text/c#" id="MyScript">
private void MyFunc(object sender, EventArgs e)
{
TextBox1.Text = "Test";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button runat="server" Text="Button" id="Button1" onClick="MyScript.MyFunc()"/>
<asp:TextBox runat="server" id="TextBox1" MaxLength="10" Rows="1" Columns="10"/>
</form>
</body>
</html>
If it helps any, I'm using Microsoft Expression Web, because I don't have anything else other than C# Express (No asp.net support)
I'd appreciate any help.
|
|
|
|
|
You need to add the runat=server attribute to your script tag
<runat="server"</b>>>
It is a better implementation to use a code behind file, htough I'm not usre if Expressions supports this. Why not use Visual Web Developer Express Edition?
<div class="ForumSig"><hr>only two letters away from being an asset</div>
|
|
|
|
|
Ha ha, thanks. I feel dumb.
And, Expressions "allows" codebehind, but doesn't "support" it. Now that I know there's a Visual Web Developer Express... I'm off to go find it!
|
|
|
|
|
I'd like to know if it is possible to not allow Shift Click to open in a new browser window. This is IE6.x I'm wondering about.
I haven't even begun to think IE 7.x yet.
Do social engineers have quality assurance?
|
|
|
|
|
Dear All
I have a datagrid in a page, i wrote a code to take a value from this datagrid and then send it to another page to open in a popup window and below is the code.
=====================The code=====================
window.showModalDialog("TradesForReuterCode.aspx?ReuterCode=" + RouterCode + "", 'static' , "status=2,scrollbars=1,left=(screen.width-width)/2,top=(screen.height-height)/2,width=420,height=600");
===================================================
the another popup page opened normally, but the problem is when i try to colse the popup window my parent page make postback and i don't want this, i try a solution to make a button and write another code to close the popup window and below is the code
===================================================
function CloseMe()
{
self.close();
window.opener.location.reload(false);
}
=====================================
But still have the same problem
plz if anyone face this problem before try to help me and thank you in advance
|
|
|
|
|
Hi,
I have the master page inside I am writing like this:
<asp:textbox id="txtStartDate" runat="server">
and in Popup.aspx:
<asp:calendar id="calDate" onselectionchanged="Change_Date" runat="server">
Page_Load
control.Value = Request.QueryString["textbox"].ToString();
Change_Date(...) event for the calendar
string strScript = "window.opener.document.forms(0)." + control.Value + ".value = '";
strScript += calDate.SelectedDate.ToString("MM/dd/yyyy");
strScript += "';self.close()";
strScript += "</" + "script>";
RegisterClientScriptBlock("anything",strScript);
But it is not working Without master page the code is working fine.
Please any one provide me the code for this.
Thanks in advance
|
|
|
|
|
I have a .DLL in my Project/App_code folder, it works without adding any import statements to my .aspx programs on local machine. But when I upload my web app, it says my DLL don't exist. What can I do, can anyone help me, I appreciate it.
|
|
|
|
|
the DLL is both in my project's /bin and /app_code directory and I receive this message.
Compiler Error Message: CS0103: The name 'Sel' does not exist in the current context.
|
|
|
|
|
I solved it, but was wondering If I can change the location of the DLLs, perhaps more local. I had to go up to the root and place my bin folder there. Can I put it in my project folder somehow?
|
|
|
|
|
Assuming this an assembly from another project, or third party, you need to add a reference to it in your application. That's all it should take.
only two letters away from being an asset
|
|
|
|
|
Hi,
In my Webapp. i want the user to type in some fields (textboxes) press the add button.
Then directly is has to be seen in gridview, datalist,...
At the same time the textboxes are made empty and i can type in new things in those textboxes,
press the add button again --> clear textbox, add new line at grid...
How do i have to start,...
Is there maybe a better way to display something like this,...
Thanks
A
|
|
|
|