|
ok, another question.
correct me if im wrong, but to my understanding, i can host any application that has an activex component (like word, excel, acrobat etc) inside a winform application.
how can i (if at all) create a general winform that can host every application type, even those that doesnt arrive with an activex component ?
thanx again,
|
|
|
|
|
Yes, in theory.
You can't, at least not in a way that is reliable and OK for production code. You can try embedding any window as a child in your app, but anything could happen. If we didn't need ActiveX controls to do this, no-one would bother writing them.
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, I am trying to get user to input text in a form (textboxes) in all CAPS irrespective of CAPS lock turned on or off. I would really appreciate if someone can suggest how this can be done.
Thanks!
|
|
|
|
|
You could force them to with some fancy Javascript, but why bother? (And anyway, they may turn Javascript off.) But there's nothing to stop you converting their input to uppercase when they post it back to the server if you want, with a simple ToUpper method....
Fred
|
|
|
|
|
hi Fred, Thanks for your reply. I did convert the text to uppercase using ToUpper when submitting to the database and/or populating the form. But I still need a way to force user to enter all data in CAPS. Is Javascript the only way to accomplish this?
Teja
|
|
|
|
|
tjkota wrote: Is Javascript the only way to accomplish this?
Well, yes. You can't control the CAPS key on their keyboard, that's for sure.
But remember that a user can elect to disable all javascript in their browser, so you can never be 100% sure that this will always yeild the results you want, and will still have to cater for lower case input getting through to the server.
Still... most people do allow Javascript, so... you could use the keyup / keypress functions to test each character as they type it, but these functions are notriously tricky to get them to work consistently across all broswers on all platforms. A safer option wiuld be to test their input either in the onblur event of the textbox (ie when they leave it) or even on the form submit stage, returning false if it isn't "right".
Fred
|
|
|
|
|
tjkota wrote: Is Javascript the only way to accomplish this?
Of course - javascript is the only code that runs on the client end.
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 )
|
|
|
|
|
Thanks Fred and Chris. I figured out a way to force all CAPS using onkeyup() event handler of Javascript.
Teja
|
|
|
|
|
I'd like to use a different web.config for debugging my webapplication at my local machine, without renaming or sth.
Is there a way to do this?
The reason is I don't wanna use the same strange database names etc. for my local database like the ones generated by my webhoster. I also would like to use different passwords. (My connectionString is stored in the web.config)
Hope somebody can help me.
|
|
|
|
|
You could get around this by creating a testing section (development) with your connectionString and a production section with your webhoster connectionString in your web.config. When you are testing locally just comment out the production section and uncomment the development section. When you are done testing locally and are ready for production comment the development section and uncomment the production section.
Nathan
|
|
|
|
|
Thats what i'm doing at the moment, but it's time consuming if you have to do it several times. Is there no other way?
|
|
|
|
|
I never understand why people save their connection strings in web.config... how unsecure is that?
This is how I avoid your problem:
1) In global.asax I have a function like this:
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Select Case Server.MachineName.ToLower
Case "aaaaa"
' local
Application("ServerName") = "local"
Case "bbbbb"
' laptop
Application("ServerName") = "laptop"
Case Else '
' live
Application("ServerName") = "live"
End Select
End Sub
You will need to find out, if you don't know already, your local machines name. User Server.MachineName in any aspx page to find out if you need to.
2) I then make a publicly available function such this:
Public Class myFunctions
Public Function dbConnection(ByVal ServerName As String) As String
Select Case ServerName
Case "live"
Return "data source=xxxxx;initial catalog=xxxxx;uid=xxxxx;pwd=xxxxx"
Case "local"
Return "data source=yyyyy;initial catalog=yyyyy;uid=yyyyyy;pwd=yyyyyy"
Case "laptop"
Return "data source=zzzzzz;initial catalog=zzzzz;uid=zzzzz;pwd=zzzzz"
End Select
End Function
End Class
3) Then I can use the same code throught my app to connect to the database on whateve computer I am running on:
Dim myFunction As New myFunctions
Dim objConn As New SqlClient.SqlConnection
objConn.ConnectionString = myFunction.dbConnection(Application("ServerName"))
Works a treat!
-- modified at 15:11 Tuesday 28th August, 2007
Of course, you don't acually need to use the Application object at all, but could call the function directly with
objConn.ConnectionString = myFunction.dbConnection(Server.MachineName)
if you replaced the Select..Case in the dbConnection function with the amchine names there instead of the aliases I created. But there was a reason I did it this way when I first came up with it - just can't remember what it was now! - and I have always done it the same way since!
Fred
|
|
|
|
|
Dear All,
I am placing an image button inside a gridview:
<asp:GridView ID="equipmentGrid" runat="server" AutoGenerateColumns="false" OnRowCommand="equipmentGrid_RowCommand">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton i="image" runat="server" ImageUrl='<%# Eval("equipment_image", "~/Images_Equipment/Small/{0}") %>' CommandName="imageClick" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="category" HeaderText="Category" HtmlEncode="false">
<HeaderStyle HorizontalAlign="left"/>
<ItemStyle Wrap="true" HorizontalAlign="left" Width="50px" />
</asp:BoundField>
|
|
|
protected void equipmentGrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandSource=="image")
{
Response.Redirect("http://www.google.com");
}
}
I want to be able to handle the click of the imagebutton. I tried using onrowcommand but the application is not even accessign the method it just returns an in valid postback error.
I tried modifying the event validation to true but no success. the error does not pop up but the method is still not invoked.
Thanks a lot
Chris
|
|
|
|
|
Change your if statement to check the e.CommandName instead of e.CommandSource.
if(e.CommandName == "imageClick")<br />
{<br />
Response.Redirect("http://www.google.com");<br />
}
I also noticed that your ImageButton id said i="image" instead of id="image" but that could just be a typo.
<asp:ImageButton i="image" runat="server" ImageUrl='<%# Eval("equipment_image", "~/Images_Equipment/Small/{0}") %>' CommandName="imageClick" />
Nathan
|
|
|
|
|
Hi,
How to use LDAP Authentication....
This is the documents:-
Internet on basis of the access rights granted to the logged in user. This web application will use through LDAP authentication.
pls tell me...How to strat...i need full Documents...
advance thanks
thank you,
Somasundaram
|
|
|
|
|
In order to test LDAP, you need to have Active Directory installed in your LAN. and (of course) you need to have the access permission to access this service from Server (Windows Advanced Server 2000 or Windows 2003 Server).
Then, you can try to access like that..
Eg from Implementing Active Directory Services in ASP.NET 2.0:
Dim adsRoot As New DirectoryEntry("LDAP://OU=ADSI,DC=ent,DC=ds,DC=microsoft,DC=com")<br />
<br />
Dim adsSearch As DirectorySearcher = New DirectorySearcher(adsRoot)
You can google about this[^] if you want more details about how to use DirectoryService in your project...
Hope it helps..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hello,
iam looking for a char control for asp .net 1.0 with features how:
.zoom
.map
.chart types
some one can guide me
thanks for the time
regards
|
|
|
|
|
I have made a small ASP script.
But I don't know how to insert that script in HTML document. Because I think, if I insert this script in that HTML document, it will work on a server, if not it will not work.
|
|
|
|
|
In order to run an asp script it should be placed in an asp file and NOT an html file. This file should be placed on a server running IIS or a similar web server supporting asp/.net suc as cassini. When accessed from the server, the page is rendered an html data is displayed in the browser.
You seem to be quite a beginner hence I suggest to get up a good book and try to move steb by step with it.
Should you have any queries please do contact me.
Thank you very much
Chris
|
|
|
|
|
hi I want to deploy my asp.net application running on iis 6, on windows vista home premium edition that runs iis 7??
is that possible..if so how??
I already created the web setup for the application (.msi and .exe) files to install the application on the localhost of the computer having windows vista but it cannot be installed, I dunno why??
|
|
|
|
|
Nada Adel wrote: I already created the web setup for the application (.msi and .exe) files to install the application on the localhost of the computer having windows vista but it cannot be installed, I dunno why??
What is the error message that you get when you run the installer?
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
something like that:
The installation is incomplete, or has been interrupted, please restart windows installer...something like that
|
|
|
|
|
Nada Adel wrote: something like that:
The installation is incomplete, or has been interrupted, please restart windows installer...something like that
Have you tried to manually deploy your project (basically copy the whole project folder over to the client machine, create a folder for it under IIS Manager and change its property to application type)?
Pete Soheil
DigiOz Multimedia
http://www.digioz.com
|
|
|
|
|
Hi i have list of values in my dropdownlistbox...,
All those want to be store in my table...,
How to do that?
Ex:
This is my code:
Dim strinsertproc As String
strinsertproc = "submitManPowerDetails '" & Val(ddlContractor.SelectedItem.Value) & "','" & Val(ddlProject.SelectedItem.Value) & "'"
sqlcmd = New SqlCommand(strinsertproc, sqlconn)
sqlcmd.Connection.Open()
sqlcmd.ExecuteNonQuery()
sqlcmd.Connection.Close()
sqlcmd.Dispose()
See in that ddlproject is dropdownlistbox...,
The above code will store which value have selected that one only...,
But instead of that in that what are the values that dropdownbox contains, all the values want to store in my table...,
How to do that one...,
Plz hlp me,
Regards,
Magi
|
|
|
|
|
How do you populate your drop down list? Do you use a stored proc or some other method to populate the drop down list? You will need to change your insert stored proc to accept a varchar and then pass in the values populated in your drop down list via a string array. I am still confused at why you would want to save this information though. Your insert proc should only be inserting what was selected by the user and adding that to your database table. Will the items in your drop down list be changing very often?
Nathan
|
|
|
|