|
If your customer name is in a text box, then maybe something like this:
string customerName;<br />
<br />
foreach ListItem anItem in repeater.Items<br />
{<br />
customerName = (TextBox)anItem.FindControl("txtCustomerName").text;<br />
}
|
|
|
|
|
Thanks For your help.
Bye..........
|
|
|
|
|
I have a radio button on my page and a drop down. the drop down contain some list of titles. if your kind of title does not exist then the user will select the radio button and a text box appears for him to enter his title. How do I do this without using Javascript.
Hrlp!!!
Thanks
AC
|
|
|
|
|
You set AutoPostback to true for the radio button, so that it makes a postback, which enables you to show the text box in the server event.
Note though, that the postback is using Javascript. So if you want to make it without Javascript all together, the answer is that it can't be done.
---
b { font-weight: normal; }
-- modified at 3:07 Wednesday 14th June, 2006
|
|
|
|
|
Hi all.
I would like to develop a DAL to work with MySQL and the .net connector for asp.net 2.0
I create a dataset with the correct data in it and return that as a function. The object datasource can see it and will connect it to a gridview. When the page is run the gridview is populated correctly.
The problem comes when i try to edit the grid view. The columns do not display inside VWD 2005, so i cannot edit them at all.
Is it possible to force a schema on the objectdatasource that the IDE can use.
I have seen it done with custom collections, but as I do not understand them yet I wanted to use a dataset.
The code I have so far is
Private Sub dbConn()
If Not conn Is Nothing Then conn.Close()
Dim connStr As String
connStr = "Server=localhost;Database=dls;Uid=blag;Pwd=blahblah;"
conn = New MySqlConnection(connStr)
End Sub
Public Function selectAllMessages() As DataTable
dbConn()
Dim da As MySqlDataAdapter
Dim Data = New DataTable("messages")
da = New MySqlDataAdapter("SELECT * FROM tbl_messages", conn)
conn.Open()
da.Fill(Data)
Return Data
End Function
|
|
|
|
|
hi!
i m working with a recrsive function to implement a tree structure i got the following output
1
2 ---- 1
4 ---- 2
3 ---- 1
5
now i have a problem that i m unable to solve how can i handle the spaces so it will look something like this
1 --- 0
2 ---- 1
4 ---- 2
3 ---- 1
5 --- 0
second i want to put all this in a datagrid. the method i adobted is that i filled the datagrid with all the parent nodes (in example 1 and 5) and then thinking to add the recursive function returned values under the appropriate parent row (but dont know how to add that result in a datagrid) can any body guide me in this regard that weather its the right way to do it if so then how can i accomplish this (how to make the result a row and then add that to under there parent row in datagrid)
or
if there is some better way then guide me please
regards
shezi
-- modified at 2:48 Wednesday 14th June, 2006
|
|
|
|
|
I am using ASP1.1. I have built a custom error page to post error details, whenever an error occurs in the application. The syntax is as below
session("error") = Ex.message()
response.redirect ("errorpage.aspx")
in "ErrorPage.aspx" i have written the following code on page_load:
lbl_error = session("error")
Problem:
1. I have set an Invalid connection string property in my web.config
2. While the application is running it goes to the Global.asax page and triggers the Application_Error Event
3. There i have written the following code
Dim Message As String = "An unhandled exception thrown. This can also be due to session expiry. Please see the below information. " & _
"MESSAGE: " & Server.GetLastError().Message & _
"STACK TRACE:" & Server.GetLastError().GetBaseException.ToString & _
"PATH: " & Request.Path
Session("Error") = Message
Response.Redirect("ErrorPage.aspx")
Response.End()
4. It rightly goes to the "ErrorPage.aspx"
5. But the Session("error") has a value of nothing
Could anyone guide me on what to be done...or what could have caused this problem
My Session State mode is "InProc"
M Kumar
Senior Software Developer
Coimbatore
-- modified at 2:27 Wednesday 14th June, 2006
|
|
|
|
|
I'm trying to allow users to upload a file to a predetermined folder using the asp:FileUpload control and the SaveAs() method. When page posts back, I get the error:
"Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
The app is hosted, so I can't alter the folder's write permissions directly. The best I could get from the hosting company was a clarification that my app is restricted to "medium" security level and a suggestion to Google the error.
I'm not really clear on Code Access Security, and from what I've read, it seems I can't gain any additional permissions this way anyway. Does anyone have any suggestions on how to accomplish this? I've been all over the Internet looking for a solution to this, and I'm pulling my hair out....
Thank you!
TJ
|
|
|
|
|
You're trying to save a file to the filesystem of your web provider. The aspnet worker process will require read/write permissions on that folder for it to work... No workarounds for this, unless you save your file into a DB...
|
|
|
|
|
using System.IO;
using excel09;
using System.Reflection ;
using System.Runtime.InteropServices;
I am creating a new excel file of version 9 from template of excel 2003.
An Image is there in the template file.
The excel file is got saved and opened.But image is not getting displayed.
Code is
Page.Controls.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.Buffer=true;
//To open excel files in lower versions also
//Save the byte[] array to xl template file
string xlFileName = "Template.xlt";
string xlFilePath = Server.MapPath("../Reports/") + xlFileName;
string fileExcel = Server.MapPath("../Reports/" + xlFileName); //template file
//Creating instance for excel 9 version
//To create excel file in lower version
excel09.Application ExcelObj = new excel09.Application();
ExcelObj.Visible = true;
xlFileName = "Report - " + System.DateTime.Now.Ticks.ToString() +".xls";
xlFilePath = Server.MapPath("../Reports/") + xlFileName; //Save as file name
//Adding template to workbook
ExcelObj.Workbooks.Add(fileExcel);
Workbooks workbooks = ExcelObj.Workbooks;
_Workbook workbook = workbooks.get_Item(1);
Sheets sheets = workbook.Worksheets;
_Worksheet worksheet = (_Worksheet) sheets.get_Item(1);
//Saving excel file in 9 version format
workbook.SaveAs(xlFilePath, excel09.XlFileFormat.xlWorkbookNormal,null,null,false,false,excel09.XlSaveAsAccessMode.xlShared,false,false,null,null);
workbook.Close(null,null,null);
ExcelObj.Workbooks.Close();
ExcelObj.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject (ExcelObj);
System.Runtime.InteropServices.Marshal.ReleaseComObject (sheets);
System.Runtime.InteropServices.Marshal.ReleaseComObject (workbook);
ExcelObj = null;
workbook = null;
sheets=null;
System.GC.Collect();
//Getting from excel version 9 file
Response.WriteFile(xlFilePath);
Response.Flush();
Response.Buffer=false;
Response.End();
|
|
|
|
|
while saving excel file i am getting this error
workbook.SaveAs(xlFilePath, excel09.XlFileFormat.xlWorkbookNormal,null,null,false,false,excel09.XlSaveAsAccessMode.xlShared,false,false,null,null);
"This command is unavailable because the license to use this application has expired."
|
|
|
|
|
{
background: url("../images/button_save.gif")
repeat-x fixed
center top;
width:63;
height:27;
cursor:hand;
BORDER-RIGHT: #104a7b 0px solid;
BORDER-TOP: #afc4d5 0px solid;
BORDER-LEFT: #afc4d5 0px solid;
BORDER-BOTTOM: #104a7b 0px solid;
}
HI the above style sheet is work for internet Exlorer but it does not work on FireFox any solution ????(Style sheet is apply to ASP.NET Button control.)
Yogesh
|
|
|
|
|
You have forgotten the units on the width and height:
width: 63px;<br />
height: 27px;
Also, the "hand" value is non-standard. Use the standard value "pointer" instead:
cursor: pointer;
---
b { font-weight: normal; }
|
|
|
|
|
not working give some other solution
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
---
b { font-weight: normal; }
|
|
|
|
|
How will i create a chat application with n agents and each agent(say using different computers) handling more than 1 customers.
|
|
|
|
|
Hello to all,
I have Datagrid which is bind with an Arraylist.Now I want to Restrict display of Datagrid.I am getting all the elements of the properties in the Arraylist so when I bind Arraylist with Datagrid it displays all the columns which are properties of my class.I just need to display few columns from that.
Also I need to save all the rows of datagrid into the database when save button is click.
|
|
|
|
|
After binding to the datagrid.
You can make invisible columns which are not necessary.
by
dGrid.Columns[4].Visible = false;
dGrid.Columns[5].Visible = false;
dGrid.Columns[6].Visible = false;
|
|
|
|
|
I have tried this but its not working.......
|
|
|
|
|
If you have the AutoGenerateColumns set to true , you cannot use the Columns collection to make a particular column invisible. In this case, you can create an event handler for the ItemDataBound event, and make the particular cell of each row insivile:
e.Item.Cells[0].Visible = false;
varshavmane wrote: Also I need to save all the rows of datagrid into the database when save button is click
You simly walk through the Items collection of the datagrid control, try to get reference to the input controls and save data.
|
|
|
|
|
I want to make an ASP.NET page that outputs xml (using ContentType="text/xml", XmlTextWriter, etc...) oddly enough when I run it the web tries to read it as HTML, even though it looks like xml in the code (I'm only running it with the development server), so I'm trying to push on. Anyway, when I try to use it with the XmlDataSource it reads the file instead of processing it and then reading the XML output.
The error is: Name cannot begin with the '%' character, hexadecimal value 0x25. Line 1, position 2
The line it's refering to is: <%@ Page ContentType="text/xml" %>
Is there anyway to do what I want?
Thanks for the help.
-- modified at 23:49 Tuesday 13th June, 2006
|
|
|
|
|
Actually, you can run the ASP.NET application on the dev server and view the web page output as xml in the browser. You now can try to shut down the running dev web server, then launch the web page with the ContentType="text/xml" again. If you still see the output as html:
+ You can simply try viewing a static xml file and see if it is displayed properly.
+ You can set the Trace="true" in the Page directive and check the ContentType setting in the output
Also, the web page .aspx with the Page directive is not well-formed in XML, so you cannot use the XmlDataSource to read the file content.
|
|
|
|
|
Thanks, I guess the restart worked since it's displaying correctly this morning.
Is there any (easy) way to have the server generate an xml page that feeds an XmlDataSource? My main goal is to have two ways to view the info on my site:
1. Using the site, just like any other site
2. Using RSS
My goal was to do this by using XmlDataSource connect to an aspx file that outputted RSS so I could us it in the sites frame work or have an RSS reader hit the same aspx file. This way I only have to maintain the one page that outputs to both. Would I be better off to just make two pages?
I hope I explained this well, thanks.
|
|
|
|
|
|
I've got a site with dynamically loaded user controls (.NET 1.1). These controls make use of the page UIculture to adjust their output.
One of these dynamic controls is a dropdown that allows language(culture) selection.
The problem is, by the time the IndexChanged event fires to change the page culture, it is possible that other dynamically loaded controls have already loaded and used the old page culture.
From what I've read, mostly (.NET 2.0), it appears that manually getting the value of a dropdown from the form is required and override the InitializeCulture method (which doesn't exist in 1.1)
The above approach is difficult if the control is dynamically loaded as the control ID may not always be the same.
Ideas?
Thanks in advance.
|
|
|
|