|
Get It . Ajax
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Depends what you mean by 'simple. You've been given a link to the Microsoft AJAX library, that will give you some AJAX functionality without writing any AJAX code. Writing your own simple AJAX code would not involve using this library at all.
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 added some extra fields in the login controls,altered the respective tables,procedures but unable to pass parameters to the procudres due to this getting exception "procedure expecting parameter..."
Please help me to get out from this problem
nit
|
|
|
|
|
Is the Repeater control able to handle input? This is the code I am using right now. I am not able to get the values from the TextBox fields.
I am trying to populate a series of TextBoxes that will contain user input for the related process field. I am using ASP.NET 2.0 and C#.
Thanks!
Client Side:
<asp:Repeater ID="rptrProccessInput" runat="server">
<ItemTemplate>
Process: <%# DataBinder.Eval(Container.DataItem, "process") %> Target:<asp:TextBox runat="server" ID="txtTarget"></asp:TextBox> Comment:<asp:TextBox runat="server" ID="txtComment"></asp:TextBox><br>
</ItemTemplate>
</asp:Repeater>
Server Side:
protected void Button2_Click(object sender, EventArgs e)
{
TextBox txtTarget = null;
TextBox txtComment = null;
foreach (RepeaterItem ctrl in rptrProccessInput.Items)
{
txtTarget = (TextBox)ctrl.FindControl("txtTarget");
txtComment = (TextBox)ctrl.FindControl("txtComment");
Debug.WriteLine(txtTarget.Text +":"+ txtComment.Text);
}
}
|
|
|
|
|
You are not passing values to Textbox
try this
<asp:TextBox runat="server" ID="txtTarget" Text='<%# DataBinder.Eval(Container.DataItem, "process") %>'></asp:TextBox>
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
In this code if a lot is occupied the label turns red and if not its green.
But instead of using color i would like to use images to represent this change.
Can any one Help??
<br />
Dim sqlDataReader As Data.SqlClient.SqlDataReader= sqlLotStatus.EndExecuteReader() <br />
<br />
Dim lotStatus As String<br />
Dim textLabelName As String<br />
Dim colourLabelName As String<br />
Dim textLabelCtrl As Label<br />
Dim colourLabelCtrl As Label<br />
<br />
While sqlDataReader.Read()<br />
' Derive label names.<br />
textLabelName = "Label" & sqlDataReader("Lot_id").ToString() & "Text"<br />
colourLabelName = "Label" & sqlDataReader("Lot_id").ToString() &"Colour"<br />
<br />
' Get Label controls with derived names.<br />
textLabelCtrl = CType(Me.FindControl(textLabelName), Label)<br />
colourLabelCtrl = CType(Me.FindControl(colourLabelName), Label)<br />
<br />
' Set control properties for lot.<br />
lotStatus = sqlDataReader("status").ToString()<br />
If lotStatus = "occupied" Then<br />
textLabelCtrl.Text = sqlDataReader("Lot_id").ToString() & " is not available"<br />
colourLabelCtrl.BackColor = Drawing.Color.Red<br />
Else<br />
textLabelCtrl.Text = sqlDataReader("Lot_id").ToString() & " is available"<br />
colourLabelCtrl.BackColor = Drawing.Color.Green<br />
End If<br />
End While<br />
|
|
|
|
|
duo!@# wrote: instead of using color i would like to use images to represent this change.
then, use the image control instead of Label.
OR.
You can set the style to that label.
Example :
Style ~
<style type="text/css">
.TurnOn{
background : transparent url(http:
}
</style>
Code ~
If lotStatus = "occupied" Then
Label2.CssClass = "TurnOn";
Else
Label2.CssClass = "TurnOff";
End If
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.
|
|
|
|
|
Thank You For the code.
But is there a way were i could use images instead of labels
cos i intent to create a layout based view of a car park
transparent url(http://url.com/ig/images/myimage.png) Wht is this for?
|
|
|
|
|
This has been really bugging me, what's the best way to tell the ContentPlaceHolder not to render a <span> tag? It seems quite a design flaw because if you include a block element such as <p>, <table> or <div> inside the content page then it will not be XHTML 1.1 Strict compliant . Anyway of changing the rendering to render nothing, or a <div> tag, short of writing my own ContentPlaceHolder of course.
|
|
|
|
|
Ed.Poore wrote: if you include a block element such as , or inside the content page then it will not be XHTML 1.1 Strict compliant
You mean, p,table,div tag can't be put inside the ContentPanel?
It is very strange to me. I used to us those tags in ContentPanel all the time. I didn't have any problem with it...
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.
|
|
|
|
|
hi,
i want to build a winform that hosts an internet explorer browser window.
for the aspnet page that the browser navigates to, i want to detect if the browser is hosted in winform or not.
i thought to navigate the hosted ie to an address with a parameter like addres.com?ishosted=true
but the user can check whats the address and copy it to a regular browser window without the hosting winform and i dont want to allow this.
can anyone think of a better solution ?
thanx
|
|
|
|
|
I don't know if there's any way you can tell, unless you can check the state of the window itself, if it's a child window. I very much doubt you can do that with javascript.
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 )
|
|
|
|
|
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
|
|
|
|