|
|
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 do it?
|
|
|
|
|
You obviously know the differnt ways to store objects, surely you're then able to find out how to do it ?
viewstate is no good because it doesn't transfer between pages, and it requires sending your objects to the client, which is a security issue, and a bandwidth issue. So, it really depends on what the objects are, but I believe for both the session and viewstate, they need to be serialisable.
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 )
|
|
|
|
|
hi all,
i am using one image button up and listbox two are server controls . probelm as follows,
"when i am click on up button if did not select any value in list box i have to poup a message in java script.pls help me in this .
Thanks And Regards,
Guru
|
|
|
|
|
handle the click event. Check if the listbox has any items in it. If not, show and alert, which is a js message box.
How much help do you need, do you know any javascript ? Any tags you put on a server control that are not recognised, are passed through verbatim, so you can just write the event tags for js, and they will get passed on.
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 )
|
|
|
|
|
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
|
|
|
|