|
i dont want to assign string to an control.
but i want to create a control using string.
that is my input is "WebDateChooser"
using this input i need to genarate cotrol.
eg: WebDateChooser ctl=new WebDateChooser();
plz tell the solution.
sureshkumar
|
|
|
|
|
if so, just create control basing on the input string....
if you still got the problem, it'd be easier if you post the snippet of code here...
<< >>
|
|
|
|
|
I think that it's better if you explain what you are trying to accomplish, instead of asking how to do it the way that you think that it is done.
---
b { font-weight: normal; }
|
|
|
|
|
Hai,
How I can execute a javascript after a post back event occured.Please help me by showing the right way...
Thank You,
Siju Thomas.
|
|
|
|
|
Hi there,
IMO, just simply using Response.Write(yourJSCodehere) to client
<< >>
|
|
|
|
|
Enjoycrack,
Thanks much for your response.But when I tried this I couldn't see the expected result.That is it is executing the script and the html is rendered to the page.I don't want this.When I tried with 'RegisterStartupScript' it was working and showing the executing the javascript after rendered the html.But still it is showing the posting back after executing the script.I dreally need first complete the post back and execute the script. Means after the execution of the script no remaining post back should happen..
Any way is there...
Thank You,
Siju Thomas.
|
|
|
|
|
Hi,
I still cannot think of which situation that you want to do that...
But anyway, if you just want to execute js code and not do post back after executing js code, just simply return false in your js code as "return false" causes browser not post back to server
Hope you get the idea
<< >>
|
|
|
|
|
Hi
Place below code after post back event handler
If Not IsClientScriptBlockRegistered("anyNameToIdentify") Then
RegisterClientScriptBlock("anyNameToIdentify", "alert('here ya go !')")
..........
..........
|
|
|
|
|
Enjoycrack , arv169,
Thanks very much for your responses.I have given more explanation about my issue to get the proper solution.
Please see the function given below,
Private Sub MyMessage(ByVal strMsg As String)<br />
Dim strScript As String = "<script language=JavaScript> "<br />
' strScript += "window.onload=alert('hai alert');"<br />
'strScript += "alert(""" & strMsg & """);"<br />
If (strMsg <> "") Then<br />
If (strMsg = "CLOSE") Then<br />
strScript += "window.close();"<br />
Else<br />
strScript += strMsg<br />
End If<br />
End If<br />
<br />
'strScript += "return false;"<br />
strScript += "</script>"<br />
'Response.Write(strScript)<br />
If (Not Page.IsStartupScriptRegistered("clientScript")) Then<br />
Page.RegisterStartupScript("clientScript", strScript)<br />
'Page.RegisterClientScriptBlock("clientScript", strScript)<br />
End If<br />
End Sub
Here 'strMsg' is the javascript which comes from user specification(Means user can execute any javascript).
I have executed it under 'Page_Load' event after doing every operation.
Here it is rendering the html and executing the javascript.This one I required. But the only one problem comes is after executing the javascript only it completes the post back. that is the status bar remains in half when executing javascript and ends the post back.
I need it should complete the post back and execute the javascript.
For example if i specify the script:- alert('hai'); it must show the message after the posting back complete.
Currently it is showing the message half the way of post back and when i click ok button of the alert message box it is completing the post back..
I beleve you got the point..
Any chance....
|
|
|
|
|
Put the javascript code in a function, and call that function from the onload event in the body tag.
---
b { font-weight: normal; }
|
|
|
|
|
Hai Guffa,
I am sorry for my late reply.Thanks much for your response.Can you elaborate by giving some examples.Thanks very much
Thank You,
Rahul.P.Menon
|
|
|
|
|
Hi all. I am having problem in Crystal Report in PDF format. I write the following code. If there is a problem with that please tell me. I have designed a Crystal report
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CrystalReportViewer1.ReportSource = report
CrystalReportViewer1.Visible = True
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ostream As System.IO.MemoryStream
ostream = New System.IO.MemoryStream
report.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat)
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Response.BinaryWrite(ostream.ToArray())
Response.End()
End Sub
When I click on the button the screen goes blank. NO error, no output nothing. Please help me solve my problem.
|
|
|
|
|
hi i am sending u some code please replace your button code from my code
code is :
Dim ms As MemoryStream
ms = CType(report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), System.IO.MemoryStream)
Response.ClearHeaders
Response.Clear
Response.Buffer = True
Response.ContentType = "application/pdf"
Try
Response.BinaryWrite(ms.ToArray)
Dim filename As String = "c:\inetpub\wwwroot\jitu.pdf"
report.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, filename)
Response.End
Catch err As Exception
Response.Write("< BR >")
Response.Write(err.Message.ToString)
End Try
bye
|
|
|
|
|
Thank you Jintendra. The code is working fine. thanks a lot again..
|
|
|
|
|
Hi,
I have developed web application for hotel reservation.When I am entering data everything goes fine.BUT if I keep page open in browser and after 2 minutes if I again try to operate on form this will give error
"Unable To Validate Data"
Please help me....
Thanks in Advance
|
|
|
|
|
try to set session timeout property
coolsweety
|
|
|
|
|
I have the Login Control on my login page. I implemented my own authenticate method so that it fires up a stored procedure in the DB to check the password. But when i punch in the correct password, it says my password is not correct. In my authenticate method, i simply output "user logged in" on a label. How do i make it so that the control itself reconizes that the login is sucessfull?
|
|
|
|
|
In your handler for the Authenticate event, make sure to set the .Authenticated property of the passed-in AuthenticateEventArgs argument to true if the user is successfully authenticated and false if not.
This example will authenticate a user named "bill" with password "evans" successfully; any other combination will be unsuccessful.
void OnAuthenticate(object sender, AuthenticateEventArgs e)
{
if (Login1.UserName == "bill" && Login1.Password == "evans")
e.Authenticated = true;
else
e.Authenticated = false;
}
|
|
|
|
|
I use AJAX in ASP.NET, in the client side code, I want to let user input data ( name, age, sex, address,...) and fill data into datagrid ( datalist ). How can i do it with javascript.
Thanks a lot !
|
|
|
|
|
I am creating a login sreen for my application. The usernames and passwords are stored in a mySQL database. the passwords are encrypted by the AES alogorithm (using AES_ENCRYPT(str,key_str) function in mySQL).
Whats the best way to check if the passwords are right?
Should i throw LoginControl.Password to a SQL statement and tell it to encrpt it to see if it matches the password in the database?
OR
Should I decrypt the password from the database, and then match it in my C# code?
OR
Should I encrypt LoginControl.Password using some AES algorithm method(maybe defined in the .net framework?) and then match it with the encrupted pass from database?
OR is there any other secure way?
thx thx for advice
|
|
|
|
|
|
The following is the error i keep getting:
-------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'upload'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %>
Line 2:
Line 3:
Source File: d:\webs\omixad\upload.aspx Line: 1
---------------------------------------------------------
I have a simple upload.aspx file that has a fileupload object on it and actually uploads files to the server.
----------------------------------------------------------------------------------------------
<code><%@ Page Language="C#" AutoEventWireup="true" CodeFile="upload.aspx.cs" Inherits="upload" %>
<script>
</script>
<!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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label" Width="255px"></asp:Label><br />
<asp:FileUpload ID="FileUpload1" runat="server" /><br />
<asp:Button id="UploadBtn" Text="Upload File" OnClick="UploadBtn_Click" runat="server" Width="105px" />
<br />
<span style="font-family: Tahoma"><span style="color: #0000ff"></span></span>
</div>
</form>
</body>
</html></code>
-------------------------------------------------------------------------------------------
The code behind file is upload.aspx.cs
-----------------------------------------------------------------------
<code>using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class upload : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void UploadBtn_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
{
//FileUpload1.SaveAs(@"C:\temp\" + FileUpload1.FileName);
FileUpload1.SaveAs(Server.MapPath(@"temp") + FileUpload1.FileName);
Label1.Text = "File Uploaded: " + Server.MapPath(@"temp\") + FileUpload1.FileName;
}
else
{
Label1.Text = "No File Uploaded.";
}
}
}</code>
---------------------------------------------------------------------
I have IIS running on my local machine. When i run this on my local machine everything works beautiful. When i upload the files to a remote webserver (earthlink web hosting) I receive the error at the top.
Now i have been reading around and googleing and everything else and others have said that i need to build the application. I have built the application by clicking build / build page (website)
Then upload the two files back up to the web server but nothing changes same errors.
Then i read something about refrences and .dll files located in a bin folder but i cannot locate these files at all nor the bin folder.
If i need to get the bin folder on the remote web server where do i find it also where do i find the .dll file after a build.
<b>Someone please give me step by step instructions of what i need to do </b>to get this to work on the remote web server. Again it works on my local machine but not when i upload it to the remote server.
Thanks in advance
|
|
|
|
|
The bin folder is located in the root folder of the application, e.g. /bin. If the root folder is at d:\webs\omixad then the bin folder is d:\webs\omixad\bin.
Upload the dll files from the folder to a bin folder on the server located in the web root.
---
b { font-weight: normal; }
|
|
|
|
|
again...
there is no folder called bin in root folder of the application.
I do not have a folder called bin and there are no .dll files.
Someone help!
|
|
|
|
|
Hi there,
In fact, with the ASP.NET 2.0 you can deploy your web pages with the source code .cs without having to compile it to the assembly and put it in the bin folder. In this case, i would double check if the ASP.NET version 2.0 is used with the application on the remote server.
|
|
|
|