|
Hi all
i am using asp.net , C# , ajax1.0
i want to know is it possible to perform client side validation for not allowing date before current date + 5 that is if i am entering a date today(11-09-08) then it should not allow any date before 16-09-08
Please help
Thank you.
imran khan
|
|
|
|
|
use regularexpression and set its expression dynamically, so you coup with the current date
|
|
|
|
|
You would have to parse the string and create a Date object from it, and create a Date object to compare it with. Something like:
if (/^\d\d-\d\d-\d\d$/.test(input)) {
var today = new Date();
var limit = new Date(today.getYear(), today.getMonth(), today.getDay()+5);
var arr = input.split('-');
var inputDate = new Date(parseInt(arr[2],10), parseInt(arr[1],10)-1, parseInt(arr[0],10));
if (inputDate >= limit) {
alert('Date is ok.');
}
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi,I'm using FDFKit for creating PDF files in my web application.
The pdf template is created using Adobe Life Cycle Desinger(v8.0), with a text field whose Name filed is "Name". in my .Net C# code im trying to populate the field dynamically as following:
string name = "google";
FdfAppClass FdfAcX_App = new FdfAppClass();
FdfDoc outputFDF = (FdfDoc)FdfAcX_App.FDFCreate();
outputFDF.FDFSetFile("http://machinename/websharedpath/myfile.pdf");
outputFDF.FDFSetValue("Name", name, false);
Response.ContentType = "application/vnd.fdf";
Response.Write(outputFDF.FDFSaveToStr());
Response.End();
outputFDF.FDFClose();
PDF is opening properly but the value is not set in the field. Please help me in this issue.
Thanks KC
|
|
|
|
|
I believe that the problem is with Life Cycle Designer. Try creating a pdf with acrobat, creating a text field "Name."
I ran into the same problem a while back, and Adobe Expert Aandi Inston confirm that:
"LiveCycle forms don't support the FDF format, you do indeed have to
use Acrobat forms."
See the forum:
http://www.adobeforums.com/webx/.59b4a578/19[^]
|
|
|
|
|
I've been working my first web site and I'm trying to connect in my oracle with this code..
and i'm using Microsoft web developer 2008
Dim oraCommand As OracleCommand = New OracleCommand(strSQLRecords, oraConnection)
Dim oraDataAdapter As OracleDataAdapter = New OracleDataAdapter(oraCommand)
Dim oraDS As New Data.DataSet
oraDataAdapter.Fill(oraDS)
Return oraDS
but I always get the error in the oraDataAdapter.Fill(oraDS) line
"ORA-12154: TNS:could not resolve the connect identifier specified"
hope you can help me with this problem..
thanks in advance
modified on Wednesday, September 10, 2008 11:42 PM
|
|
|
|
|
your tnsnames.ora is not configured correctly
Click Here
|
|
|
|
|
my tnsname is fine. and I've already re-installed the oracle 10g in my computer but
it only producing the same error..
|
|
|
|
|
It does sound like your tnsnames.ora file is not configured correctly.
Can you connect to the DB via tools such as SQL Tool or Toad. They can utilise the TNSNames file settings to connect to the relevant DB, as least with this way you can establish if the tns.ora file at fault or not. You can also try manually connecting to the DB using these tool to validate any credentials etc..
Other options are to check the listeners are configured correctly and will accept connections
Hope these ideas help
Rich
|
|
|
|
|
Hi,
I am tring to write in event log but i have security problem
I have done some searchs but nothing usful for now
VS 2008 AND VISTA Home
String eventSource;
eventSource = "TESTc";
EventLogPermission eventLogPermission = new EventLogPermission(EventLogPermissionAccess.Write, System.Environment.MachineName);
System.Diagnostics.EventLog eLog = new System.Diagnostics.EventLog("Application", System.Environment.MachineName);
eLog.Source = eventSource;
eventLogPermission.PermitOnly();
eLog.WriteEntry("This test now", System.Diagnostics.EventLogEntryType.Information);
----------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Yes. CreatiVity withOuT limiTs
|
|
|
|
|
This is Releated to Security Acees Persmission.
are you facing the problem from local enviroment or after deployment of your application.
if you deployed your application on IIS then you can face this problem becuase i think you are run your application on Default Application Pool .
You just create your own application pool and Give the Identity to local System that your application has the access to write on local system event viewer. then Asing this application pool to your web application !!!
Hope this will resolve yopur problem !!!
cheers,
Abhijit
Think Sharp | Code Sharp | C Sharp
|
|
|
|
|
yes its work
but
I have problem when creating event Source
Yes. CreatiVity withOuT limiTs
|
|
|
|
|
hi every one...!
em creating a create user account page.
i want to check the username is already exists in my database table or not?
if exists then give me a error message that username is already exists if not then account will be successfully create.
em using this code but its not work correctly..
i dont know whatz de problem. and please remember em using Access database.
please point out my mistakes.
Dim objConnection As OleDbConnection
Sub Page_Load(Source As Object, E As EventArgs)
objConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " _
& "DATA SOURCE=" _
& Server.MapPath("nwind.mdb;"))
End Sub
Sub btnInsert_Click(ByVal Sender As Object, ByVal E As EventArgs)
Dim query As String
query = "Select Count(*) From login Where username = ? "
Dim result As Integer = 0
If result > 0 Then
Dim strSQL As String = "INSERT INTO login (username, [password]) " & _
"VALUES (?, ?) "
Dim dbComm As New OleDbCommand(strSQL, objConnection)
dbComm.Parameters.Add("UserName", OleDbType.VarChar, 32, "UserName")
dbComm.Parameters.Add("Password", OleDbType.VarChar, 128, "Password")
dbComm.Parameters("UserName").Value = txtUserName.Text
dbComm.Parameters("Password").Value = txtPassword.Text
Try
objConnection.Open()
dbComm.ExecuteNonQuery()
Catch ex As Exception
Response.Write(ex.Message)
Response.End()
Finally
If objConnection.State = ConnectionState.Open Then
objConnection.Close()
End If
End Try
Response.Write("A new record has been added")
Response.End()
Else
Response.Write("your username is already exist")
End If
End Sub
|
|
|
|
|
asad_black wrote: Dim query As String
query = "Select Count(*) From login Where username = ? "
Dim result As Integer = 0
If result > 0 Then
Perhaps running the query against your DB is a good move ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
asad_black wrote: Dim query As String
query = "Select Count(*) From login Where username = ? "
Dim result As Integer = 0
If result > 0 Then
Well, there's a pretty good start. You've defined a query and then you don't use it anywhere. You initialise result to 0, and then test to see if result is greater than zero. Are you seeing the problems with that?
asad_black wrote: Dim strSQL As String = "INSERT INTO login (username, [password]) " & _
"VALUES (?, ?) "
Dim dbComm As New OleDbCommand(strSQL, objConnection)
dbComm.Parameters.Add("UserName", OleDbType.VarChar, 32, "UserName")
dbComm.Parameters.Add("Password", OleDbType.VarChar, 128, "Password")
Here you define your query with ? placeholders and then don't use them to when assigning your parameters. There are lots of things wrong here, and you should take the time to look into it.
|
|
|
|
|
asad_black wrote: If result > 0 Then
I think if you will modify your condition mentioned above to:
If result = 0 Then
then it will work.
|
|
|
|
|
I have an ASP.NET applications (using VB.Net code) having 2 webforms and it loads couple of Crystal Reports each time depending upon selections.
my execution path is as follows :
http://localhost/webApps/PIN/WebForm2.aspx (it loads this page correctly)
"WebForm2.aspx" is having some selection criterias for the report to be loaded. But when this page loads I get an CrystalReportViewer message on top left corner of the page which is as follows:
CrystalReportViewer - CrystalReportViewer1<br />
Use ReportSource or DataBindings property to specify a report source.
Also, in "WebForm1.aspx", I've got the following - OdbcSelectCommand, OdbcDataAdapter, OdbcConnection. And when I click on the "Command Text" property of "OdbcSelectCommand" which is infact an SQL query, I get this error messsage too : " [S1000] [IBM] [Client Access Express ODBC Driver (32-bit)] Syntax error in Connection String"
This is the connection string that I'm using :
Me.OdbcConnection1.ConnectionString = "DSN=as400;UID=pcain;PWD=marugo"
Please see the code below to see how Crystal Report is loaded :
Protected WithEvents active_referral1 As Crystal_dataset.active_referral
Protected WithEvents As400ds1 As crystal_dataset.as400ds
Me.OdbcSelectCommand1.Connection = Me.OdbcConnection1
Me.OdbcConnection1.ConnectionString = "DSN=as400;UID=pcain;PWD=marugo"
OdbcDataAdapter1.Fill(As400ds1)
If Report_Type = 3 Then
active_referral1.SetDataSource(As400ds1)
active_referral1.DataDefinition.FormulaFields("unboundstring3").Text = "'" & Fac_Str & "'"
active_referral1.DataDefinition.FormulaFields("unboundstring4").Text = "'" & Race_Str & "'"
active_referral1.DataDefinition.FormulaFields("unboundstring5").Text = "'" & Rel_Str & "'"
active_referral1.DataDefinition.FormulaFields("unboundstring6").Text = "'" & Sex_Str & "'"
active_referral1.DataDefinition.FormulaFields("unboundstring7").Text = "'" & Ref_Str & "'"
active_referral1.DataDefinition.FormulaFields("unboundstring8").Text = "'" & Sub_Str & "'"
active_referral1.DataDefinition.FormulaFields("unboundstring9").Text = "'" & Sub2_Str & "'"
If View_List = 1 Then
CrystalReportViewer1.ReportSource = active_referral1
ElseIf View_List = 2 Then
MyExportOptions.ExportFormatType = CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
MyExportRequestContext.ExportInfo = MyExportOptions
MyStream = active_referral1.FormatEngine.ExportToStream(MyExportRequestContext)
Response.ClearHeaders()
Response.ClearContent()
Response.ContentType = "application/pdf"
Dim MyBuffer(MyStream.Length) As Byte
MyStream.Read(MyBuffer, 0, CType(MyStream.Length, Integer))
Response.BinaryWrite(MyBuffer)
Response.End()
End If
End If
Can anyone please give me any suggestions???
Thanks in anticipation.
|
|
|
|
|
Hi all,
I have a user control having a command button. On click of button, I've bound a javascript function which should show a div control. But, when I click on button, it postback the page.
cmdPostComment.Attributes.Add("onClick", "return showDiv();")
function showDiv()
{
document.getElementById("divPostComment_Tab1").style.display = "block";
return false;
}
I've noticed one thing, When page renders, command buttons name got changed to "control1$cmdPostComment".
Thanks in advance.
|
|
|
|
|
Add it as OnClientClick in your aspx page. That should work.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
|
Do you have auto postback turned on ? I do this all the time and it works fine, set the OnClientClick, return false from it, and the Onclick will not run.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Neeraj Arora wrote: document.getElementById("divPostComment_Tab1").style.display = "block";
Check the ID of "divPostComment_Tab1" after rendering of the page and use that ID instead of "divPostComment_Tab1".
|
|
|
|
|
I'm adding a list of GridTab user controls to a container TabControl. Each GridTab contains only one GridView control, and my problem is that when the GridTab fires Page_Load, its GridView hasn't been instantiated yet.
I could do this in the GridTab constructor, but would really like to know why the u/c isn't doing it in this case, when it does if I add the u/c manually.
|
|
|
|
|
Hello,
Please check this link http://msdn.microsoft.com/en-us/library/bb545450.aspx[^]">. I wonder how Microsoft did hide the verticall scrollbar of IE7. I also wonder how they kept the top of page static, so the scrollbar is under the static section.
If you enlighten me about it, I would appreciate.
Thanks.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
overflow-x:hidden
in your css.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|