|
hi all,
i have built a webapplication using VS08 and IIS 5.1
then i published it to IIS but now i have noticed that the images the application has are not visible.
also the Javascript that i have added are not being added.
this was not the case when i was developing the application.
i was sure that i was path problem but i changed it <img alt="Loading" src="images/progress.gif" />
still the image is not being shown.
also if i try to browse the path http://localhost/MyApplication/images/progress.gif then i see this message
You are not authorized to view this page
can some one guide me on this.
Thanks
Sandeep
|
|
|
|
|
Check whether images folder is copied properly and whether the images are referenced properly.
Check whether any heavy resource activities are happening on server.
You can uncheck directory browing option on iis and browse the image..
Hope this will help u..
No Defeat Is Final Until You Stop Trying!.......
|
|
|
|
|
hi Surender,
Thanks for reply
well for ur questions
Check whether images folder is copied properly and whether the images are referenced properly. Checked and is there
Check whether any heavy resource activities are happening on server. NO
You can uncheck directory browing option on iis and browse the image.. even if i check or uncheck that checkbox it is not being visible
By default when u make virtual directory it has anonymous access to the application and directory browsing is turned off.
only when i published the application inside the www root of the IIS then the application worked correctly.
initially the application was posted on other folder other than the WWW root of the IIS.
i m sure it has something to do with the path outside the home directory of the IIS but wht it is im not sure of.
there is no probs with the path of Images as the same application is running well whn is hosted in WWW root
ne help will be appreciated
Thanks & regards
Sandeep
|
|
|
|
|
Try giving everyone full permission to that folder read + write. Check your browser settings if javascript is off and images off
|
|
|
|
|
Hi,
I am using repeater and i am pulling data from the datatable which itself is pulling data from the string arrays. My datatable and the repeater code is like this:
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("Name");
dt.Columns.Add("Year");
and the repeater code is like this:
DataView dv = dt.DefaultView;
rpt1.DataSource = dv;
rpt1.DataBind();
where rpt1 denotes repeater.
The ascx code for repeater is like this:
<asp:Repeater ID = "rpt1" runat="server"
onitemdatabound="rpt1_ItemDataBound"
onitemcommand="rpt1_ItemCommand" >
<ItemTemplate>
<asp:Label ID = "lbl_Year" runat="server" Text='<%# Eval("Year") %>'/></li>
<asp:Label ID = "lbl_Name" runat="server" Text='<%# Eval("Name") %>'/>
<asp:Label ID = "lbl_ID" runat="server" Text='<%# Eval("ID") %>' />
</ItemTemplate>
</asp:Repeater>
There is no problem in the output. It is showing data. But Now I want these data based on the Year. Like "Year" as a title and under that Name and ID should display. Any ideas??
suchita
|
|
|
|
|
Not exactly sure what you want but if you want to show the name and id labels below the year then use the br tag not li.
If you want year to be an expandable section then you have a bit more work.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
No not that kind. Well there are Year data like "2007", "2008","2009","2010" and the Name and ID are unique. So I want to show some think like this:
My datatable has data like this:
Year Name ID
2007 Architecture arc1
2008 Architecture arc2
2009 Architecture arc3
2010 Architecture arc2
2007 Engineering eng1
2008 Engineering eng2
2008 science sci2
2009 science sci3
2010 Engineering eng4
2010 science sci4
And i wanted to show like the one shown below:
2007
Architecture arc1
Engineering eng1
2008
Architecture arc2
Engineering eng2
science sci2
2009
science sci3
2010
Architecture arc4
Engineering eng4
science sci4
suchita
|
|
|
|
|
|
Hi Mark,
I got problems when using nested repeater. Well if i dont use nested repeater, the parent repeater is getting data from the datatable but when i use nested repeater under that parent repeater, data count in parent repeater is showing zero for the same user. i even break point in all the steps and the datacount is zero when i use the nested repeater. I dont know why is that happening ..
suchita
|
|
|
|
|
Without seeing what you are doing how can anyone possibly answer? The repeater doesn't change your data.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Ok. Let me show whatever I did so far.
I am using repeater and i am pulling data from the datatable which itself is pulling data from the string arrays. My datatable and the repeater code is like this:
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("Name");
dt.Columns.Add("Year");
foreach (string se in sec)
{
DataRow dr = dt.NewRow();
Name[] sf = Name.FindByID(se.ID);
dr["ID"] = se.ID;
dr["Name"] = se.Name;
dr["Year"] = se.Term;
dt.Rows.Add(dr);
}
and the repeater code is like this:
DataView dv = dt.DefaultView;
rptParent.DataSource = dv;
rptParent.DataBind();
where rptParent denotes repeater.
The ascx code for repeater is like this:
<asp:Repeater ID = "rptParent" runat="server"
onitemdatabound="rptParent_ItemDataBound"
onitemcommand="rptParent_ItemCommand" >
<ItemTemplate>
<li>
<asp:Label ID = "lbl_Year" runat="server" Text='<%# Eval("Year") %>'/>
</li>
<asp:Repeater ID = "rptChild" runat="server" >
<ItemTemplate>
<ul>
<li>
<asp:LinkButton ID ="lnk_Name" runat="server" Text='<%# Eval("Name") %>' CommandName = "GoToPage" CommandArgument ='<%# Eval("ID") %>'/>
</li>
</ul>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
And corresponding databound code is:
protected void rptParent_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
RepeaterItem item = e.Item;
rptChild = (Repeater)item.FindControl("rptChild");
DataRowView drv = (DataRowView)item.DataItem;
rptChild.DataSource = drv.CreateChildView("rptParent");
rptChild.DataBind();
}
Now when i don't use rptChild repeater, all the data is showing . No problem with that. But when I use rptChild repeater as shown in above codes, data is not showing. I tried it using breakpoint too. No error but it is not showing any data count in rptParent repeater.I tried this using
rptParent.Items.Count .
The count is 4 when i run the program without child repeater but it is 0 when i run the program with the child repeater. Can you tell me why this happens and how can I get out of this error ?
suchita
modified on Friday, November 19, 2010 9:23 AM
|
|
|
|
|
Hey,
I found the error.
when i the cursor comes to this code
rptChild.DataSource = drv.CreateChildView("rptParent");
it throws the exception.
It said "The relation is not parented to the table to which the Dataview points" .
But what can be done in this case ? Any ideas ??
suchita
|
|
|
|
|
It helps quite a lot when you learn to use the debugger.
The exception is very obvious, you have not create a relationship. How does the framework know the data in a DataTable has any relationhip unless you tell it. Software development isn't magic.
http://msdn.microsoft.com/en-us/library/0k21zcyx(v=VS.100).aspx[^]
Reading the documentation and understanding the tools you are working will help great deal.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I got it working now. My problem is solved. Thank you Mark.
suchita
|
|
|
|
|
You're welcome
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
lbllink.Text= dsLink.Tables[0].Rows[0]["CSV"].ToString()
when i am binding a data from sql query[like ,<a href="login.aspx">LINK1</a>,<a href="login.aspx">LINK2</a> ,<a href="login.aspx">LINK3,LINK33</a>
like this to a <asp:label> as above, i am getting only
<a href="login.aspx">LINK1</a> ,<a href="login.aspx">Link3,Link33</a>
instead of links like Link1,Link2,Link3,Link33
How to render HTML to label
modified on Thursday, November 18, 2010 4:36 AM
|
|
|
|
|
Hi
i found the issue and solution is when binding like above the < and > symbols are binded as "lt" and "gt" so i used replace function to replace those to < and > tags and i got the links
thanks
|
|
|
|
|
Hi,
I having trouble with assigning dynamically checkbox's Checked value using values from a datatable.
Here's my code
<asp:checkbox runat="server" id="chk1" checked="<%# (DataBinder.Eval(Container.DataItem,"Enable")) %>">
How can i automatically convert the field Enable which is from datatable so it will be assigned as Checked's value?
That field's type is bool and values 0 or 1.
Many Thanks!
|
|
|
|
|
Checked='<%# IIF(ISDBNULL(Eval("dbFlg")),0,Eval("dbFlg")) %>'>
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
i made a Web Service project in visual studio 2008.
then added 2 "Web Service" files to the project.
Service1.asmx
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <system.web.script.services.scriptservice()> _
<system.web.services.webservice(namespace:="http://tempuri.org/")> _
<system.web.services.webservicebinding(conformsto:=WsiProfiles.BasicProfile1_1)> _
<toolboxitem(false)> _
Public Class Service1
Inherits System.Web.Services.WebService
<webmethod(true)> _
Public Function HelloWorld() As String
Session("foo") = "bar"
Return "Hello World"
End Function
End Class
Service2.asmx
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <system.web.script.services.scriptservice()> _
<system.web.services.webservice(namespace:="http://tempuri.org/")> _
<system.web.services.webservicebinding(conformsto:=WsiProfiles.BasicProfile1_1)> _
<toolboxitem(false)> _
Public Class Service2
Inherits System.Web.Services.WebService
<webmethod(true)> _
Public Function HelloWorld() As String
If Session("foo") <> "bar" Then
Throw New UnauthorizedAccessException
End If
Return "Hello World"
End Function
End Class
After i made a windows application, where i made a "Service Reference" to both web service classes/files.
The problem is that Service1.asmx doesn't share it's session with Service2.asmx,...
I get the thrown "UnauthorizedAccessException" on calling "Service2.HelloWorld()" because the session is not created in Service2.asmx after calling Service2...
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim bhp As New System.ServiceModel.BasicHttpBinding
bhp.AllowCookies = True
Dim x As New ServiceReference1.Service1SoapClient(bhp, New ServiceModel.EndpointAddress("http://localhost/ImsBrowserWebService/Service1.asmx"))
Dim y As New ServiceReference2.Service2SoapClient(bhp, New ServiceModel.EndpointAddress("http://localhost/ImsBrowserWebService/Service2.asmx"))
MsgBox(x.HelloWorld)
MsgBox(y.HelloWorld)
' Dim x As New localhost.Service1
' MsgBox(x.HelloWorld())
' Dim y As New localhost1.Service2
' MsgBox(y.HelloWorld())
End Sub
End Class
How to share the session between those files,... In Visual Studio 2003 it works fine when calling the service from javascript,... Now in visual studio 2008 with the soap client wizards it doesn't...
Any help would be welcome,
...
allowcookies="true"
|
|
|
|
|
hi mates,
i need help.
i have 2 modal window, page1.aspx and page2.aspx.
in page1.aspx, i have button to call page2.aspx.
in page2.aspx, i have gridview with command field select.
if i click the selected row, the values will go to page1.aspx which has textboxes.
and automatically close the page2.aspx and
refresh the page1.aspx.
how will i do that?
in my mind, i will have to put arguments in page1.aspx?somevalue=
but how will i refresh the page1.aspx.
thanks in advance.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Having problems with free PDF library sharpPDF and allowing it to write PDF file to child directory within ASP.NET application. The PDF is created just fine in my development environment but when deployed to production application (on same computer just separate folder) I receive the below exception.
I tried several different things such as:
- adding <trust level="Full"> to my web.config file for the application.
- verifying NTFS security settings on app directory. Added IIS_WPG with modify privileges. IIS_USRS had modify access already. As well NETWORK SERVICE has modify privileges.
Let me know any suggestions.
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. <br />
<br />
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.<br />
<br />
Source Error: <br />
<br />
<br />
Line 97: }<br />
Line 98: <br />
Line 99: pDoc.createPDF(strOutputFilename);<br />
Line 100:<br />
Line 101: Response.ContentType = "Application/pdf";<br />
<br />
Source File: D:\TerritoryServer\Workspace\WebApp\rtest.aspx.cs Line: 99 <br />
<br />
Stack Trace: <br />
<br />
<br />
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]<br />
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0<br />
System.Security.CodeAccessPermission.Demand() +54<br />
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +2103<br />
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +138<br />
System.IO.FileStream..ctor(String path, FileMode mode) +91<br />
sharpPDF.pdfDocument.createPDF(String outputFile) +82<br />
TerritoryServer.rtest.Page_Load(Object sender, EventArgs e) in D:\TerritoryServer\Workspace\WebApp\rtest.aspx.cs:99<br />
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25<br />
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42<br />
System.Web.UI.Control.OnLoad(EventArgs e) +132<br />
TerritoryServer.SecurePage.OnLoad(EventArgs e) in D:\TerritoryServer\Workspace\WebApp\clsSecurePage.cs:92<br />
System.Web.UI.Control.LoadRecursive() +66<br />
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11045655<br />
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +11045194<br />
System.Web.UI.Page.ProcessRequest() +91<br />
System.Web.UI.Page.ProcessRequest(HttpContext context) +240<br />
ASP.rtest_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\de52e180\1e8e29d2\App_Web_poyidmvv.3.cs:0<br />
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599<br />
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
|
|
|
|
|
David Hovey wrote: IIS_USRS had modify access already.
ASP.NET has it's own user-account, called ASP.NET[^]. Does that one have the appropriate rights?
I are Troll
|
|
|
|
|
Just tried that. Didn't notice that user account, but it doesn't work. Still receive exception.
|
|
|
|
|
My apologies, simply assumed that the account lacked read/write rights. You could try changing the trust level[^]
I are Troll
|
|
|
|