|
ASPnoob wrote: Then the "Enter the object names to select" pane (in the Select Users or Groups dialog box) shows up
That's because you have specified an account that doesn't exist.
Click the Advanced button instead, then Find Now, and locate the account in the list.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have selected advance and find now, selected "Machine Name/ ASP.NET" account, and selected the permission of choice. I restarted VS 2003 and asp.net, but it still does not work. Please tell me what to do.
-- modified at 1:08 Tuesday 7th August, 2007
|
|
|
|
|
Then you add the account to the list, select it in the list, and check Write in the Allow column.
What is it that "does not work"?
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
I am new to asp.net and C# and I am trying to make some checkboxes dyamicly. I use a database with it.
I however have run into a problem since my code seems to work but I don't think it is in the right area. I make everything on page_load but when a person clicks the submit button I need some way to check if each box has been checked or not. Since I made it on page_load I can't access the checkboxes anymore so I am not sure what I need to do.
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Collections;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Data.SqlClient;<br />
<br />
public partial class Default4 : System.Web.UI.Page<br />
{<br />
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
SqlConnection conn = new SqlConnection("Server=localhost\\SqlExpress;Database=Japanese;" + <br />
"Integrated Security=True");<br />
SqlCommand comm = new SqlCommand("SELECT HiriganaID,letter,image FROM test", conn);<br />
conn.Open();<br />
SqlDataReader reader = comm.ExecuteReader();<br />
while (reader.Read())<br />
{<br />
CheckBox test = new CheckBox();<br />
<br />
test.ID = (string) reader["letter"];<br />
<br />
Image image = new Image();<br />
image.ImageUrl = (string)reader["image"];<br />
Panel1.Controls.Add(image);<br />
Panel1.Controls.Add(new LiteralControl("<br />"));<br />
Panel1.Controls.Add(new LiteralControl(" "));<br />
Panel1.Controls.Add(new LiteralControl(" "));<br />
Panel1.Controls.Add(new LiteralControl(" "));<br />
Panel1.Controls.Add(test);<br />
Panel1.Controls.Add(new LiteralControl("<br />"));<br />
}<br />
reader.Close();<br />
conn.Close();<br />
}<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
<br />
if (test.Checked == true)<br />
{<br />
ArrayList arrary = new ArrayList();<br />
arrary.Add(test.ID);<br />
Response.Write(test.ID + "checked" + "<br />");<br />
}<br />
}<br />
<br />
}<br />
|
|
|
|
|
Hi,
You cannot directly access the checkbox.Because you added it in to the panel.So you should refer panel to get it.
One way for that is to use panel1.FindControl(...) method.
To succeed, we must first believe that we can.
Sherin Iranimose
|
|
|
|
|
HI
I am creating a PDF document on fly. The purpose of the creation to read from the created file and write to the client ( Browser). I am wondering is there any way I can directly pumpt the data to the reponse object. I am using iTextSharp for creation of the file and it expects a FileStream. The code is
PdfWriter.GetInstance(rptDocument, new FileStream("report.pdf", FileMode.Create));
Any help?
Thanks
Mahidhar
|
|
|
|
|
Mahidharb wrote: I am using iTextSharp for creation of the file and it expects a FileStream.
No, it doesn't. It expects a Stream.
Use the Response.OutputStream property.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi, check this out. I hope this is what you're looking for.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Set the appropriate ContentType.
Response.ContentType = "Application/pdf"
'Get the physical path to the file.
Dim FilePath As String = MapPath("acrobat.pdf")
'Write the file directly to the HTTP output stream.
Response.WriteFile(FilePath)
Response.End()
End Sub
This is the site if you need it.
|
|
|
|
|
Hi
I am trying to write a file (with dynamic contents) from asp.net ( Code behind C#) on the server. My application is ending up with error when I am attempting to open the file in create mode.
I could not get past this statement and any help is greatly appreciated.
Thanks
Mahidhar
|
|
|
|
|
Sounds like the ASPNET account does not have write/create access. However, granting write/create access may be your easiest option but not the most secure one.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
HI George,
Thanks for the good suggestion. I have modified the access permissions for the folder (i.e Server.MapPath) through OS File Manager(Explorer). Added ASPNET user as well as the default logged in users name with write & Execute permissions. Still I am unable to create the file from ASPX/.CS page.
Additionally I also enabled to write permissions for the site in IIS and restarted IIS on every attempt with no luck yet.
I am using VS 2003 on Windows XP Media Center edition.
Thanks for the tips as it gave me a direction to troubleshoot the issue.
Thanks
Mahidhar
|
|
|
|
|
|
Hi Frnd,
I am able to create and read files from Stand alone applications. I am also able to read files from default folder in IIS too. I had the problem to create a new file in IIS context.
Any way thank you for the attempt though it is deviated from the actual request.
let me know if you have faced similar problem or know the work around.
Thank you very much
Mahidhar
|
|
|
|
|
it is really agonising when u complete 70 percent of the coding then have to recode.
actually i was just about to complete my project when my pc was stormed by a virus.
so i copied the file from defaullt visual studio folder to removable drive
mind u " from visual studio folder" and not from WWW folder.
then i formatted and then indtalled the od again
then again i installed VS.Net
but then i could access it as it was showing one error message
"the project file cannot be found"
perhaps i have made mistake while copying.
the mistake being copying location was a vs folder not a IIS folder.
suggest me something through which i can work it out.
|
|
|
|
|
It sounds like you copied the solution files (*.sln, *.proj), but not the code files in the IIS directory. You should have at least one file (*.aspx) for each page in your project. If this is not the case, you have no hope of recovering your project. You wiped it out without backing up all the files.
|
|
|
|
|
Hello all,
This may be a repost but I can't find the original message.
I have a server asp:button control in the content place holder of a content page.
I create the event handler in the code behind through the properties editor. When I click on the button the server side event won't get fired.
I tried using a postback and an hidden input to change a value to achieve the same effect to no avail.
The hidden input's value does not get updated.
What am I missing?
Thank you.
Alberto Bar-Noy
Project Manager
http://www.consist.co.il
|
|
|
|
|
Hi,
I am having linkbuttons using buttonfield column. grid gets diplayed and when click the linkbutton to open another page using window.open(Javascript)in rowcommand.every thing works fine.
Issue is:
1. when i first time I click the linkbutton on the grid - opens a page A in new window(window.open).
2. when i second time I click the another linkbutton on the grid - opens a page B in new window(window.open).
3. then I click the back button on the browser(gridpage) - now It automatically opens up the page A , Which I dont expect.
Please let me know how to avoid the window that get opened up when I go back on the browser.
For your Information I Paste the code I use.
Linkbutton column:
<asp:buttonfield commandname="proj_no" datatextfield="proj_no" headertext="Project No."
="" text="Project No.">
<itemstyle cssclass="ca_item_proj">
<headerstyle cssclass="ca_header_border">
Rowcommand:
If e.CommandName = "proj_no" Then
Dim i As Integer = Convert.ToInt32(e.CommandArgument)
Dim proj_no As String
proj_no = CType(ctrl, LinkButton).Text
Session("projectno") = proj_no
Response.Write("javascript:window.open('LinkAspApp.aspx','','scrollbars=yes,menubar=yes,height=600,width=800,resizable=yes,toolbar=yes,location=yes,status=yes');")
endif
Thanks
Mohamed
|
|
|
|
|
Hi,
I am using an ajax update panel with an image button inside, i want to show a message when i click tue button:
Protected Sub button_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles button.Click
Dim msgAlert As String = "alert('My message');"
Microsoft.Web.UI.ScriptManager.RegisterStartupScript(Page, Me.GetType(), "click", msgAlert, True)
End Sub
But when i click the button the message doesn't show, but if put the button outside the update panel the message does show.
i wonder if somebody knows how to show messages when we use an update panel.
Thanks,
Alberto Martinez
|
|
|
|
|
please provide some code or explanation how to store user defined class objects using c#.net. actually i have one class and want to store its objects in my web application. please help me for that. so what to use cache,view state or session object and how?
|
|
|
|
|
To change ObjectDataSource sorting order I use SelectingEventHandler
ObjectDataSourceValitutAsukkaat.Selecting += new ObjectDataSourceSelectingEventHandler(ObjectDataSourceValitutAsukkaat_Selecting);
void ObjectDataSourceValitutAsukkaat_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.Arguments.SortExpression = "SURNAME";
}
But how to change dynamically Objectdatasource sorting collation ?
|
|
|
|
|
|
But how to change collation order in sorting ?
Tableadapter table default locale is "Finnish", but in runtime I want use different collations
|
|
|
|
|
What are you binding your objectdatasource to? If it is a gridview, all you have to do is set the SortExpression to the data field you want to sort by when the column header is clicked.
Ben
|
|
|
|
|
I'm using ObjectDatasource with ReportViewer control and choose
different collation order.
|
|
|
|
|
I am not that familar with the ReportViewer control. I would assume it work similar to other controls, so it should have a sorting event that should get called when the control is requesting a different sort. If it does have a sorting event you could do something similar to what I have documented in my article I posted before.
Ben
|
|
|
|