|
Yes. App_Data is storage for files like Mdf, XML etc. The real advantage is that any file you place in App_Data won't be downloadable .
Those file can be accessable by developer/Coder but not from outside, because these are not downloadable. This is the reason I guess Image not showing, as they get downloaded.
Please share your input.
Cheers !
Abhijit
Codeproject MVP
|
|
|
|
|
Yeah. You are right. I just tried with a simple sample. The image in the App_Data is inaccessible. Good to know.
|
|
|
|
|
Hi,
i developed the application in .Net Framework 1.1, the same application is working other Operating System Machines except Windows 7. if i open the application in Windows 7 Machine and click any buttons the Validation controls not working. What should i do for this? should i do any setting changes for this?
|
|
|
|
|
Could you give a few more details? (i.e. code snippet) Were you using regular expression validator controls or similar? What browsers have you tried?
|
|
|
|
|
I used the required field validator control, for checking the text box is null or not. but the same application is working in other operating system server. In the Windows 7 System , IIS is 7 and IE 8.0
. In other OS Machine when we click on the buttons it is checking the textboxes and showing the Error Messages.i copied the same application in other machines.
|
|
|
|
|
Hi I am using pop up extender in repater control.I have alink button asscoiated with for the pop up extender in repeater .I want to do processing in item command event which is not firing.
Pop up window is coming but the itme command is not firing.After some research on google i find out pop up extender block the events aasscoaited with target control id of pop up extender..
Pls note:If I remove the pop up extender then the event is firing.Clearly the issue seems to be with Pop up extender its blocking the event.
Any solutions would be really appreciated.
I have searched everywhere.
Thanks in adavnce.
Sats
|
|
|
|
|
Hi,
this is no direct answer to your question - so sorry in advance - but maybe you can solve your issue
the other way arround. Target your popup extender to a simple label like:
<asp:label id="NullControl" runat="server">
<ajax:modalpopupextender id="someExtender" runat="server" targetcontrolid="NullControl"
="" popupcontrolid="DetailsPopupPanel" cancelcontrolid="CloseButton" dropshadow="false">
And then, when your itemcommand fires, open the popup from codebehind using [extenderName].Show();.
Im doing that in a gridview and it works perfectly.
Good Luck
|
|
|
|
|
Don't set the target to the link button. Set it to some other button outside the repeater that isn't visible. Then in the item command call .show on the popup control. If you don't want a full postback you need to wrap it all in an updatePanel.
|
|
|
|
|
Dear All,
I have two listBox in my webpage which i am adding items from one to other using Javascript works fine
like i have source and destination listboxes. i am adding items from source to destination using javascript
and source is binded with datasource.
after post every thing is cleared from destination listbox.
any ideas how to save the state of both listboxes after postback?
i enabled page viewstate to true and both listbox view state to true but seems it doesent work and the same
i enabled pageviewstate in web.config file no success
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
If you are using a button to trigger the postback you could examine the data in each listbox within that event and store the data in some way (Session, ViewState, etc) and repopulate the boxes during the OnLoad event taking into account that this is a PostBack so you might have a method like:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (IsPostBack)
{
}
else
{
}
}
That should get you started.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
Hey Abdul,
Changes done in the client-side using JavaScript will not save it ViewState. To ASP.NET, it doesn't know that you have changed something. To fix this, use a hiddenfield. When you hit the button, get the list of item into the hiddenfield with delimiters. Once the page is back, fill the list with the items with the hiddenfield value.
Only HiddenField can maintain states all the times.
|
|
|
|
|
Thanks, HiddenField do save the status, Its really appreciated.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
hello all,
I want to fetch the static text written at html design page and then fetched data be entered into some variable at code-behind.
could anyone know the code to do so?
|
|
|
|
|
You might face problem of having some html into string variable. Please use the class "HttpUtility" and it method/property as required.
Thanks,
Arindam D Tewary
|
|
|
|
|
If content is inside a td/div/span/p then you can give the container control an Id and set its runat="server". At the server side you can access the control text using the InnerText or InnerHTML property.
WWW, WCF, WWF, WPF, WFC .... WTF
|
|
|
|
|
|
I think you have problem for getting server side error when enter html code in textbox.
For the security reason asp.net does not allow this.
But you can enable it by making
<%@ Page validateRequest="false" %>
Mohan
|
|
|
|
|
Hello,
I have a ListView with EditItemTemplate.
The problem is when I edit an Item, the EditItemTemplate showing out,
but the items layout below the EditItemTemplate become weird.
I attach my screenshot and code behind, hope any one can help me.
http://img28.imageshack.us/img28/3550/91358941.jpg[^]
http://img202.imageshack.us/img202/3694/62318841.jpg[^]
<LayoutTemplate>
<table border="0" width="100%" style="background-color: #FFFFFF; border-collapse: collapse;
border-color: #999999; border-style: none; border-width: 1px; font-family: Verdana, Arial, Helvetica, sans-serif;">
<thead>
<tr style="background-color: #E4E4E4; color: #FFFFFF;">
<td align="left" width="55%">
<asp:Label ID="docLabel" runat="server" Font-Size="10" Font-Names="Arial">DOCUMENT</asp:Label>
</td>
<td align="left" width="30%">
<asp:Label ID="Label8" runat="server" Font-Size="10" Font-Names="Arial">LAST UPDATE</asp:Label>
</td>
<td width="15%">
</td>
</tr>
</thead>
<tbody>
<tr id="itemPlaceholder" runat="server" width="100%" />
</tbody>
<tfoot>
<table width="100%">
<tr>
<td align="center" width="100%" style="text-align: center; background-color: #E4E4E4;
font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF">
<asp:DataPager ID="DataPager1" runat="server">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowNextPageButton="False"
ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</tfoot>
</table>
</LayoutTemplate>
<EditItemTemplate>
<table width="100%" border="1" cellspacing="0" cellpadding="0" style="border: thin dotted #FF0000">
<tr>
<td align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<br />
<td align="right">
Name
</td>
<td>
:
</td>
<td align="left">
<asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' Visible="false" />
<asp:TextBox ID="namebox" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
Permission
</td>
<td>
:
</td>
<td>
<br />
<table border="0" cellpadding="0" cellspacing="0" style="width: 68%">
<tr>
<td align="center">
Available Group
</td>
<td>
</td>
<td width="47%" align="center">
Selected Group
</td>
</tr>
<tr>
<td>
<asp:ListBox ID="GroupListBox" runat="server" Width="125px" DataSourceID="SqlDataSource5"
DataTextField="Name" DataValueField="ID" Height="160px"></asp:ListBox>
</td>
<td>
<asp:Button ID="selectAllBtn" runat="server" Text=">>" CommandName="SelectAll" />
<br />
<asp:Button ID="selectBtn" runat="server" Text=" > " CommandName="SelectOne" />
<br />
<br />
<asp:Button ID="deSelectAllBtn" runat="server" Text="<<" CommandName="DeselectAll" />
<br />
<asp:Button ID="deselectBtn" runat="server" Text=" < " CommandName="DeselectOne" />
</td>
<td>
<asp:ListBox ID="selectedGroupListBox" runat="server" Width="125px" DataSourceID="SqlDataSource6"
DataTextField="Name" DataValueField="ID" Height="160px"></asp:ListBox>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right">
PDF File
</td>
<td>
:
</td>
<td align="left">
<asp:LinkButton ID="pdfFile" runat="server" Text='<%# Bind("pdfPath") %>' />
<cc1:AsyncFileUpload ID="pdfFileUpload1" runat="server"/>
</td>
</tr>
<tr>
<td align="right">
Source File
</td>
<td>
:
</td>
<td align="left">
<asp:LinkButton ID="sourceFile" runat="server" Text='<%# Bind("docPath") %>' />
<cc1:AsyncFileUpload ID="sourceFileUpload1" runat="server" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">
<asp:Button ID="updateBtn" runat="server" Text="Update" CommandName="Updated" />
<asp:Button ID="CancelBtn" runat="server" Text="Cancel" CommandName="Cancel" />
</td>
</tr>
</table>
</EditItemTemplate>
<ItemTemplate>
<td runat="server" style="">
<table cellpadding="0" cellspacing="0" class="style14">
<tr>
<td>
<img src="images/arrow.gif" style="width: 18px; height: 18px" />
</td>
<td>
<asp:Label ID="subCatID" runat="server" Text='<%# Eval("ID") %>' Visible="False"></asp:Label>
<asp:LinkButton ID="LinkButton3" runat="server" Font-Names="Arial" Font-Size="10pt"
Font-Underline="False" ForeColor="Black" Text='<%# Eval("Name") %>' CommandName="Click"></asp:LinkButton>
</td>
<td width="2px">
</td>
<td align="right">
<asp:ImageButton ID="editSubCatBtn" runat="server" ImageUrl="~/images/pencil_16.png"
title="Edit" CommandName="Edit" Visible='<%# CBOOL(Eval("subCatModifyable")) %>' />
</td>
<td align="right">
<asp:ImageButton ID="delSubCatBtn" runat="server" CommandName="Delete" ImageUrl="~/images/delete_16.png"
title="Delete" Visible='<%# CBOOL(Eval("subCatModifyable")) %>' />
</td>
</tr>
</table>
</td>
</ItemTemplate>
C@lven Yow
modified on Thursday, April 1, 2010 3:47 AM
|
|
|
|
|
My webform has a link to download a sverver file: "http://Server/App/UpLoad/File1.xls".But when I have upload a new file to replace the old file(File1.xls),this link still download the old file.The stanger thing is when I have deleted "File1.xls",it also download the old file(where the old file from ?!).
All of our client machines have this problem,but when used in the Server's browser, it all works well.
Can anyone help me?
Thanks a lot.
Forgive my poor English
|
|
|
|
|
Xiaoming Qian wrote: But when I have upload a new file to replace the old file(File1.xls)
Do you have screen to upload the files? If yes, check whether it is uploading to the right location or probably uploading?
|
|
|
|
|
You can give a try just checking whether you have anything 'hard coded' inside the application code.
Even deleting from source downloads the same file prompts me thinking same.
Thanks,
Arindam D Tewary
modified on Thursday, April 1, 2010 2:53 AM
|
|
|
|
|
.xls file gets cached in the temporary internet file folder, try clearing the client browser cache.
WWW, WCF, WWF, WPF, WFC .... WTF
|
|
|
|
|
Is it possible to use ASP.NET Control in MVC Patterns
|
|
|
|
|
Why not! You can use them... MVC is a pattern..There is a framework too that can be used to build ASP.NET application using it.
For more:http://www.asp.net/mVC/[^]
|
|
|
|
|
Good people,
Hello. Our webservice is not working. We should be receiving information via an HTTP POST. However, nothing is working. Below are the code files. Let me know what you think. Thanks in advance for any help or information you can provide. (By the way, some information (e.g. class names, connection strings, etc...) has been removed or changed in order to hide any sensitive information.
<pre>
Imports System.Web.Mail
Imports System.Data
Imports System.Data.SqlClient
Imports System.IO
Partial Class hbcertification
Inherits System.Web.UI.Page
Public strBody As String = ""
Public sqlInsertStr As String = ""
Public errStr As String = ""
Public txn_id, first_name, last_name, address_street, address_city, address_state, address_zip, address_country, address_phone, payer_email, Price, key, invoice, payment_date, mc_fee, buyer_ip As String
Dim myConn As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionInfo"))
'*******************************************************************************************
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
strBody += "Test email sent.<br><br>Customer name: " & Request("first_name") & " " & Request("last_name")
strBody += "<br>Reg Key: " & Request("key") & "<br><br>Transaction ID: " & Request("txn_id") & "<br>Tran Type: " & Request("txn_type")
updateFile(Server.MapPath("log.txt"), strBody)
txn_id = Request("txn_id")
first_name = Request("first_name")
last_name = Request("last_name")
address_street = Request("address_street")
address_city = Request("address_city")
address_state = Request("address_state")
address_zip = Request("address_zip")
address_country = Request("address_country")
address_phone = Request("address_phone")
payer_email = Request("payer_email")
Price = Request("Price")
key = Request("key")
invoice = Request("invoice")
payment_date = Request("payment_date")
mc_fee = Request("mc_fee")
buyer_ip = Request("buyer_ip")
If Request("first_name") <> "" And Request("last_name") <> "" Then
SendMail("jamesrobertson@hotmail.com", "feedback@morris.com", strBody, "Software Order Notification", "sales@morris.com")
Else
Response.Write("<br>Email not sent. Name missing.")
End If
Dim sItem As String
Response.Write("<br><hr noshade size=""1"" />")
If Request.Form("dosubmit") = "1" Then
Response.Write("FORM VALS:")
For Each sItem In Request.Form
Response.Write("<br>" & sItem & " - [" & Request.Form(sItem) & "]")
Next
sqlInsertStr += "insert into aspnet_MorrisCustomerInfo (TransactionID,FirstName,LastName,AddressStreet,AddressCity,AddressState,AddressZip,AddressCountry,AddressPhone,PayerEmail,Price,AuthenticationCode,InvoiceID,PurchaseDate,PaypalFee,PurchaseIPAddress) values ('" & SQLSafe(txn_id) & "','" & SQLSafe(first_name) & "','" & SQLSafe(last_name) & "','" & SQLSafe(address_street) & "','" & SQLSafe(address_city) & "','" & SQLSafe(address_state) & "','" & SQLSafe(address_zip) & "','" & SQLSafe(address_country) & "','" & SQLSafe(address_phone) & "','" & SQLSafe(payer_email) & "','" & SQLSafe(Price) & "','" & SQLSafe(key) & "','" & SQLSafe(invoice) & "','" & SQLSafe(payment_date) & "','" & SQLSafe(mc_fee) & "','" & SQLSafe(buyer_ip) & "')"
runMyQuery(sqlInsertStr, False)
End If
Response.Write("<br>sqlInsertStr is: " & sqlInsertStr)
Response.Write("<br><hr noshade size=""1"" />")
End Sub
'*******************************************************************************************
Sub SendMail(ByVal strEmailAddress, ByVal strEmailAddress_cc, ByVal Email_Body, ByVal Email_Subject, ByVal Email_From)
If Request.ServerVariables("server_name") <> "localhost" Then
Try
Dim resumeEmail As New MailMessage
resumeEmail.To = strEmailAddress
resumeEmail.Cc = strEmailAddress_cc
resumeEmail.From = Email_From
resumeEmail.Subject = Email_Subject
resumeEmail.Priority = MailPriority.High
'resumeEmail.BodyFormat = MailFormat.Html
resumeEmail.BodyFormat = MailFormat.Html
resumeEmail.Body = Email_Body
'System.Web.Mail.SmtpMail.SmtpServer = "morris.com"
System.Web.Mail.SmtpMail.SmtpServer = "relay-hosting.secureserver.net"
System.Web.Mail.SmtpMail.Send(resumeEmail)
Response.Write("<br>Email sent.")
Catch exc As Exception
Response.Write("<br><b>MAIL ERROR OCCURRED</b><br><br>" & exc.ToString() & "<br>From: " & Email_From)
End Try
Else
Response.Write("<br><br><b>TEST RESPONSE</b><br><br>" & strBody & "")
End If
End Sub
End Function
End Class
<%@ Page Language="VB" Debug="true" AutoEventWireup="false" CodeFile="hbcertification.aspx.vb" Inherits="hbcertification" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Process Data</title>
</head>
<body>
<form id="form1" runat="server">
<br /><br />
</form>
</body>
</html>
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
<add key="ConnectionInfo" value="********************************************************" />
<add key="maintable" value="test123" />
<add key="sitename" value="Hyper - Another Dimension" />
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
</pre>
-- Modified Thursday, April 1, 2010 7:54 AM
|
|
|
|
|