|
Balaji.K wrote: how to run the url in linux...there is the way...?
Yes.
By Using
(1) XSP
(2) Apache.
For more details Here[^]
Regards,
Satips.
|
|
|
|
|
You can use,
* Apache
* Grasshopper
|
|
|
|
|
hi all..
My asp.net application has a dropdowlist, am populating employee names in it from the database,i want one color for the active employees and another color for the inactive employees..is it possible to color the items of the dropdown based on a condition..
plz..help..
|
|
|
|
|
|
Hi,
I have created a custom asp:CreateUserWizard control. I have also included in the <WizardSteps> a <asp:WizardStep> control for personal information. Why doesn't my required field validator want to fire??
Last Name *<br />
<asp:TextBox
ID="txtLastName"
Columns="30"
MaxLength="50"
runat="server" /><br />
<asp:RequiredFieldValidator
ID="RequiredFieldValidator_LastName"
ControlToValidate="txtLastName"
Display="Dynamic"
ErrorMessage="First Name required"
ValidationGroup="CECreateUserStep1"
runat="server">Required
</asp:RequiredFieldValidator>
When I remove the ValidationGroup="CECreateUserStep1" setting then it works fine.
Please can someone help me with my confusion??
Regards
ma se
|
|
|
|
|
I pretty sure that someone came across the same dilemma: Where should I maintain the database connection object, should I open it once when the web application is started and close id when it is terminated or should I open and close it with each session.
Which strategy is the one that is usually used ?
|
|
|
|
|
A database connection should be opened as late as possible and closed as soon as possible. So you should only open it when needed in your application, like when retrieving data to bind to a datagrid for instance, not when the initial page that only has static content is displayed.
only two letters away from being an asset
|
|
|
|
|
Hi,
When we do the export to excel from a webpage it works fine. But when I try to do the same thing from a popup window, it is doing nothing. It is not exporting the data. I am opening the popup using window.showModalDialog() method. The code that I am using to export the grid is
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
Please let me know the solution for this.
THanks,
sridhar.
|
|
|
|
|
I don't think you can display excel file in modal dialog. Can't you use window.open() instead of window.showModalDialog() ?
If you need to use modal dialog, then put an iframe in your modal dialog page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModalDialogPage.aspx.cs" Inherits="ModalDialogPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Excel export</title>
<link type="text/css" rel="Stylesheet" href="ModalDialogPage.css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<iframe name="excelExporter" src="excelExporter.aspx"></iframe>
</div>
</form>
</body>
</html>
note stylesheet file modalDialogPage.css:
body
{
margin:0px 0px 0px 0px;
padding:0px 0px 0px 0px;
border: none 0px #000000;
width:100%;
height:100%;
}
iframe
{
margin:0px 0px 0px 0px;
padding:0px 0px 0px 0px;
border: none 0px #000000;
width:100%;
height:100%;
scrolling:no;
frameborder ;
}
and then you can put your excel generating code into your excelExporter.aspx page.
should be working!
Pilo
|
|
|
|
|
I didn't completely understand what you are saying. But here is the problem I am facing. In the popup window I have the tag <base target="_self" />. THis tells the browser to display the results in the same window instead of opening in a new window. So when I do the export to excel it is not able to display the save/open dialog because of that. If I remove that tag, it is able to display that dialog but the problem is everytime I do a postback it opens the new window to display the results.
Thanks,
sridhar.
|
|
|
|
|
I have figured the solution for this. I have added onclick event to the excel button. The onclick event will open a new window using window.open method. In that new window I have the code that exports the data to excel.
Thanks,
sridhar.
|
|
|
|
|
Hi, I have tried to upload a file to a MySQL database for a week now and still have problems. Would you please check to see what is causing the exception "Invalid cast from System.String to System.Byte[]." The following are my code for uploading a file to the database. I would really like to know why its giving me that error message, thank you in advance for your help.
----------------------------------------------------------------------------------------------------------------------------------------
| Field | Type | Null | Key | Default | Extra |
----------------------------------------------------------------------------------------------------------------------------------------
| docID | int(11) | NO | PRI | NULL | AUTO_INCREMENT |
|
| docTitle | varchar(30) | NO | | NULL | |
|
| docContent | MediumBlob | NO | | NULL | |
|
| docDate | timestamp | NO | | CURRENT_TIMESTAMP | |
|
| docType | varchar(15) | NO | | NULL | |
----------------------------------------------------------------------------------------------------------------------------------------
Imports System.IO
Imports System.Data.Odbc
Public Class Upload
Inherits System.Web.UI.Page
Private Sub Submit1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Submit1.Click
Dim strFileEx As String
Dim StrFileType As String
Dim intFileLen As Integer
Dim objStream As Stream
Dim strInsert As String
Dim myConnection As OdbcConnection
Dim cmdInsert As OdbcCommand
If Not IsNothing(txtFileContents.PostedFile) Then
'Determines File Type
strFileEx = Right(txtFileContents.PostedFile.FileName, 4)
Select Case strFileEx.ToLower
Case ".doc"
StrFileType = "doc"
Case ".ppt"
StrFileType = "ppt"
Case ".htm"
StrFileType = "htm"
Case ".html"
StrFileType = "html"
Case ".txt"
StrFileType = "txt"
Case Else
StrFileType = "jpg"
End Select
'Grab the content of uploaded file
intFileLen = txtFileContents.PostedFile.ContentLength
Dim arrFile(intFileLen) As Byte
objStream = txtFileContents.PostedFile.InputStream
objStream.Read(arrFile, 0, intFileLen)
'Add UpLoaded file to a database
myConnection = New OdbcConnection("Provider=MySQLProv; Data Source=Data;User Id=myID;Password=myPWD")
strInsert = "INSERT into QUsers (docTitle,docContent,docDate,docType) values (?,?,?,?,?)"
cmdInsert = new odbcCommand(strInsert,myConnection)
cmdInsert.Parameters.Add("@docID",OdbcType.int,30)
cmdInsert.Parameters["@docID"].Values =""
cmdInsert.Parameters.Add("@docDate", OdbcType.TimeStame,14)
cmdInsert.Parameters["@docDate"].Values = DateTime.Now.ToShortDateString()
cmdInsert.Parameters.Add("@docTitle", OdbcType.Varchar,30 )
cmdInsert.Parameters["@docTitle"].Values = txtFileTitle.Text
cmdInsert.Parameters.Add("@docType", OdbcType.Varchar,30)
cmdInsert.Parameters["@docType"].Values =StrFileType
cmdInsert.Parameters.Add("@docContent",OdbcType.Text)
cmdInsert.Parameters["@docContent"].Values =arrFile
myConnection.Open()
cmdInsert.ExecuteNonQuery()
myConnection.Close()
End If
End Sub
End Class
|
|
|
|
|
Hi,
Your parameter "@docContent" its datatype should be OdbcType.Binary or OdbcType.VarBinary.
Coz these two datatypes are mapped to an array of Byte.
I hope this will help you.
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
I have changed that error you have pointed out but I still get the same error message. The change from Odbctype.Text to OdbcType.Binary had been made for @docContent and still VS2003 throws the same exception. I don't know what else to do, all of the other variables have been checked for invalid type
casting and I don't see any. Please help me spot the error. Thank you in advance for your help.
-- modified at 23:29 Thursday 7th June, 2007
|
|
|
|
|
Hi,
R u getting the same error at the same line as previous one?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Yes, I get the same error message as before. I even tried changing Binary to VarBinary and that didn't help either. Please take at look at my code for me to see where the problem is. VS2003 says it's the line that says cmdInsert.ExecuteNonQuery() that is causing the problem and it marked that line red. Is there anyway that you can run my code to see where the problem is? Please help me solve this problem, I ran out of ideas. Thanks again for your time.
-- modified at 11:42 Friday 8th June, 2007
|
|
|
|
|
|
my cookie object is deleted when i run application at second time. why? though i gave expiry days.
|
|
|
|
|
are you overwriting some blank data at second time?
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
Hi ,
I would like to add item in web control RadioButtonList using java script .
Any help is appriciated.
Regards
Rajesh
rajesh
|
|
|
|
|
function RadioChecked(param)
{
{
var frm = document.forms[0];
// Take all elements of the form
for (i=0; i < frm.length; i++)
{
// itinerate the elements searching "RadioButtons"
if (frm.elements[i].type == "radio")
{
// Unchecked if the RadioButton is != param
if (param != frm.elements[i].id )
{
frm.elements[i].checked = false;
}
}
}
}
}
Regards,
Satips.
|
|
|
|
|
Thanks Satips,
But my question is how to add item in RadioButtonList .
Like I write a code in code behind .cs file
RadioButtonList.item.add(a);
RadioButtonList.item.add(b);
RadioButtonList.item.add(c);
RadioButtonList.item.add(d);
RadioButtonList.item.add(e);
Similarly , i want to add item in RadioButtonList using java script.
How can i do it?
Regards
Rajesh
rajesh
|
|
|
|
|
What method do you think is better when there are many threads?
Regards,
Analizzatore Cloro
|
|
|
|
|
You can't do that. The RadionButtonList control doesn't exist in the browser, it only exists on the server while the page is created.
As what you are asking for is impossible, what is it that you want to accomplish?
---
single minded; short sighted; long gone;
|
|
|
|
|
You cannot do as how you have stated for the Radio Button list.
Since the Radio buttonlist control exist on the server side while the page is creatred this method is impossible.
so go with the method as how i have stated before.
Regards,
Satips.
|
|
|
|