|
Hi,
Try this
Button1.attributes.add("onClick","test()") // For VB
Button1.attributes.add("onClick","test()"); // For C#
where test() is a javascript function to be placed in js file.
javascript file should be included between <Head></Head> Tags.
Regards,
Manowj
|
|
|
|
|
Good day gentlemen...
I want to make the gridview to represent(to display) only one page and this page has only one row(one complete record of information) and this row is the newest record(the last inserted record). How can I do that?
Thanks for your help...
|
|
|
|
|
Find out about using datagrid for Paging, then follow the following steps. Paging allows you to show as many results per page as you like
1. Connect to the database.
2. Create the command object based upon the SQL query we wish to run and the connection object we wish to run it on.
3. Create the DataAdapter. This object is needed to fill a DataSet with the database results.
4. Populate the DataSet object with the results from the database query.
5. Bind the DataSet to the DataGrid Web control.
Hope that helps.
|
|
|
|
|
sir, i want to display two images in two imagebutton in a datalist but when on display i want both images to be merged at runtime even the image border should not be display..thanks in advance
|
|
|
|
|
Hi, check out this link, hope it helps
http://www.codeproject.com/useritems/JoinImages.asp
|
|
|
|
|
hi friends
I encrypt and decrypt the conncetion string in webconfig(it works fine).
The encrypt value and copy th value and paste it in webconfig.
Is the any way to automatically encrypted value generated in webconfig
regards
saravanan
|
|
|
|
|
|
|
That is a very good article..thank u for the information
Best Regards,
Tomi
|
|
|
|
|
Hi, I can not for the life of me, get XP to grant write access to my ASP.NET account. I went in to the security tab, enter MachineName\ASPNET, and hit Add. Then the "Enter the object names to select" pane (in the Select Users or Groups dialog box) shows up, but I don't know what to put in it. Please help me with this, thank you in advance for your help.
|
|
|
|
|
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.
|
|
|
|