|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Really Stuck on a Canlendar Control PLEASE HELP!!!Hi guys,
This is what I'm doing, have a calendar control that I'm invoking from an hyperlink. the calendar control has some javascript code that when I pick a date, the date gets transffered to a text control on the calling form, that is all work working fine. Now here's the chanllenge that I'm just really stuck. I want to get that date from the calendar control to a text box within a Detailsview control. I have been trying so many things but nothing seems to work. Please some ideas on how I can do this PLEASEEEE. Thanks so much. Manny Can you post a little code or explain what you have tried so far?
Brennan Stehling http://brennan.offwhite.net/blog/ Midway wrote: Show quoteHide quote > Hi guys, > > This is what I'm doing, have a calendar control that I'm invoking from an > hyperlink. the calendar control has some javascript code that when I pick a > date, the date gets transffered to a text control on the calling form, that > is all work working fine. > > Now here's the chanllenge that I'm just really stuck. I want to get that > date from the calendar control to a text box within a Detailsview control. I > have been trying so many things but nothing seems to work. > > Please some ideas on how I can do this PLEASEEEE. > > Thanks so much. > > Manny The Hyperlink that is invoking the Calendar control is;
javascript:calendar_window=window.open('calendar.aspx?formname=NewEmployeeform.TextBox4','calendar_window', 'width=350,height=290');calendar_window.focus() The TextBox4 is a control outside the detailsview. what I was trying was to get that date to this TextBox4 control and pass that date to the TextBox within the Detailsview, I was able to do that but I need a post back to the server so the date shows up in the TextBox control within the Detailsview, but in order to get a post back to the server I need to clink on a button, that is not gonna work on the user interface. User should be able to just to click on that date and date should be inserted with the Date field in the details view no more actions done. Thanks for your help. Manny Show quoteHide quote "offwh***@gmail.com" wrote: > Can you post a little code or explain what you have tried so far? > > Brennan Stehling > http://brennan.offwhite.net/blog/ > > Midway wrote: > > Hi guys, > > > > This is what I'm doing, have a calendar control that I'm invoking from an > > hyperlink. the calendar control has some javascript code that when I pick a > > date, the date gets transffered to a text control on the calling form, that > > is all work working fine. > > > > Now here's the chanllenge that I'm just really stuck. I want to get that > > date from the calendar control to a text box within a Detailsview control. I > > have been trying so many things but nothing seems to work. > > > > Please some ideas on how I can do this PLEASEEEE. > > > > Thanks so much. > > > > Manny > > I have posted an example here...
http://brennan.offwhite.net/jsparent/ That will open a child window which allows you to set a value in a textbox and then send that back to the parent. In your situation you need a place in the parent where you can set that value. If you have a hidden field (input of type hidden) you can target it if you know the ID. And if you are using an ASP.NET control you will need to figure out that ID since the ClientID is what is actually used in the HTML. You could just shorten the ClientID. http://blog.danbartels.com/archive/2005/11/11/1110.aspx What I have done to always know the value of the ClientID is to call RegisterScriptBlock with Javascript created to set to the value of the ClientID which can then be used in a static Javascript function. In my example you can use much of the code without making changes. The Javascript/DOM code should look very similar for your solution. Brennan Stehling http://brennan.offwhite.net/blog/ Midway wrote: Show quoteHide quote > The Hyperlink that is invoking the Calendar control is; > javascript:calendar_window=window.open('calendar.aspx?formname=NewEmployeeform.TextBox4','calendar_window', 'width=350,height=290');calendar_window.focus() > > The TextBox4 is a control outside the detailsview. what I was trying was to > get that date to this TextBox4 control and pass that date to the TextBox > within the Detailsview, I was able to do that but I need a post back to the > server so the date shows up in the TextBox control within the Detailsview, > but in order to get a post back to the server I need to clink on a button, > that is not gonna work on the user interface. > > User should be able to just to click on that date and date should be > inserted with the Date field in the details view no more actions done. > > > Thanks for your help. > > Manny > > > "offwh***@gmail.com" wrote: > > > Can you post a little code or explain what you have tried so far? > > > > Brennan Stehling > > http://brennan.offwhite.net/blog/ > > > > Midway wrote: > > > Hi guys, > > > > > > This is what I'm doing, have a calendar control that I'm invoking from an > > > hyperlink. the calendar control has some javascript code that when I pick a > > > date, the date gets transffered to a text control on the calling form, that > > > is all work working fine. > > > > > > Now here's the chanllenge that I'm just really stuck. I want to get that > > > date from the calendar control to a text box within a Detailsview control. I > > > have been trying so many things but nothing seems to work. > > > > > > Please some ideas on how I can do this PLEASEEEE. > > > > > > Thanks so much. > > > > > > Manny > > > > Hey Thanks very much for your reply. if it's not too much to ask, how would
translate this code into VB? sorry I'm not that good with C#, I'm learning though, but if you could do this would be ownsome. Thanks very much. Show quoteHide quote "offwh***@gmail.com" wrote: > I have posted an example here... > > http://brennan.offwhite.net/jsparent/ > > That will open a child window which allows you to set a value in a > textbox and then send that back to the parent. In your situation you > need a place in the parent where you can set that value. If you have a > hidden field (input of type hidden) you can target it if you know the > ID. And if you are using an ASP.NET control you will need to figure > out that ID since the ClientID is what is actually used in the HTML. > > You could just shorten the ClientID. > > http://blog.danbartels.com/archive/2005/11/11/1110.aspx > > What I have done to always know the value of the ClientID is to call > RegisterScriptBlock with Javascript created to set to the value of the > ClientID which can then be used in a static Javascript function. > > In my example you can use much of the code without making changes. The > Javascript/DOM code should look very similar for your solution. > > Brennan Stehling > http://brennan.offwhite.net/blog/ > > Midway wrote: > > The Hyperlink that is invoking the Calendar control is; > > javascript:calendar_window=window.open('calendar.aspx?formname=NewEmployeeform.TextBox4','calendar_window', 'width=350,height=290');calendar_window.focus() > > > > The TextBox4 is a control outside the detailsview. what I was trying was to > > get that date to this TextBox4 control and pass that date to the TextBox > > within the Detailsview, I was able to do that but I need a post back to the > > server so the date shows up in the TextBox control within the Detailsview, > > but in order to get a post back to the server I need to clink on a button, > > that is not gonna work on the user interface. > > > > User should be able to just to click on that date and date should be > > inserted with the Date field in the details view no more actions done. > > > > > > Thanks for your help. > > > > Manny > > > > > > "offwh***@gmail.com" wrote: > > > > > Can you post a little code or explain what you have tried so far? > > > > > > Brennan Stehling > > > http://brennan.offwhite.net/blog/ > > > > > > Midway wrote: > > > > Hi guys, > > > > > > > > This is what I'm doing, have a calendar control that I'm invoking from an > > > > hyperlink. the calendar control has some javascript code that when I pick a > > > > date, the date gets transffered to a text control on the calling form, that > > > > is all work working fine. > > > > > > > > Now here's the chanllenge that I'm just really stuck. I want to get that > > > > date from the calendar control to a text box within a Detailsview control. I > > > > have been trying so many things but nothing seems to work. > > > > > > > > Please some ideas on how I can do this PLEASEEEE. > > > > > > > > Thanks so much. > > > > > > > > Manny > > > > > > > > Sorry about the last post about the VB code. What I ws trying to ask is; how
do I find out the ID of the textbox that I want the value to come down from the child? Show quoteHide quote "offwh***@gmail.com" wrote: > I have posted an example here... > > http://brennan.offwhite.net/jsparent/ > > That will open a child window which allows you to set a value in a > textbox and then send that back to the parent. In your situation you > need a place in the parent where you can set that value. If you have a > hidden field (input of type hidden) you can target it if you know the > ID. And if you are using an ASP.NET control you will need to figure > out that ID since the ClientID is what is actually used in the HTML. > > You could just shorten the ClientID. > > http://blog.danbartels.com/archive/2005/11/11/1110.aspx > > What I have done to always know the value of the ClientID is to call > RegisterScriptBlock with Javascript created to set to the value of the > ClientID which can then be used in a static Javascript function. > > In my example you can use much of the code without making changes. The > Javascript/DOM code should look very similar for your solution. > > Brennan Stehling > http://brennan.offwhite.net/blog/ > > Midway wrote: > > The Hyperlink that is invoking the Calendar control is; > > javascript:calendar_window=window.open('calendar.aspx?formname=NewEmployeeform.TextBox4','calendar_window', 'width=350,height=290');calendar_window.focus() > > > > The TextBox4 is a control outside the detailsview. what I was trying was to > > get that date to this TextBox4 control and pass that date to the TextBox > > within the Detailsview, I was able to do that but I need a post back to the > > server so the date shows up in the TextBox control within the Detailsview, > > but in order to get a post back to the server I need to clink on a button, > > that is not gonna work on the user interface. > > > > User should be able to just to click on that date and date should be > > inserted with the Date field in the details view no more actions done. > > > > > > Thanks for your help. > > > > Manny > > > > > > "offwh***@gmail.com" wrote: > > > > > Can you post a little code or explain what you have tried so far? > > > > > > Brennan Stehling > > > http://brennan.offwhite.net/blog/ > > > > > > Midway wrote: > > > > Hi guys, > > > > > > > > This is what I'm doing, have a calendar control that I'm invoking from an > > > > hyperlink. the calendar control has some javascript code that when I pick a > > > > date, the date gets transffered to a text control on the calling form, that > > > > is all work working fine. > > > > > > > > Now here's the chanllenge that I'm just really stuck. I want to get that > > > > date from the calendar control to a text box within a Detailsview control. I > > > > have been trying so many things but nothing seems to work. > > > > > > > > Please some ideas on how I can do this PLEASEEEE. > > > > > > > > Thanks so much. > > > > > > > > Manny > > > > > > > > Download Lutz Roeder's Reflector. It is a .NET utility which allows you
to load .NET assemblies and browse them. When you double-click on a class or method it can actually show you the code. You can display the code as any .NET supported language. Then you can take that C# code, compile it, load the assembly and view it as VB.NET. :) I do both VB.NET and C#, but sometimes I come across some syntax I am not sure how to translate so I use this technique. To get the ID value for the Javascript, I place this in my web page as static Javascript. <script type="text/javascript"> var controlClientId; function setControlClientId(newId) { controlClientId = newId; } // use controlClientId in your Javascript </script> Then build your string for Javascript in the code-behind and add it to the page. Dim scriptString as String = "<script type='text/javascript'>" + vbCrLf + _ " setControlClientId(" + control.ClientID + ");" + vbCrLf + _ "</script>" + vbCrLf I am not looking at working code as I write this so my syntax may be off and you may want to use a different property than ClientID but I think that is correct. To add Javascript to the page from a code-behind class, use the RegisterClientScriptBlock method. It has been updated in ASP.NET 2.0. ASP.NET 2.0 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic.asp ASP.NET 1.1 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIPageClassRegisterClientScriptBlockTopic.asp Those pages should have some decent code for you to follow. Brennan Stehling http://brennan.offwhite.net/blog/ Midway wrote: Show quoteHide quote > Sorry about the last post about the VB code. What I ws trying to ask is; how > do I find out the ID of the textbox that I want the value to come down from > the child? > > "offwh***@gmail.com" wrote: > > > I have posted an example here... > > > > http://brennan.offwhite.net/jsparent/ > > > > That will open a child window which allows you to set a value in a > > textbox and then send that back to the parent. In your situation you > > need a place in the parent where you can set that value. If you have a > > hidden field (input of type hidden) you can target it if you know the > > ID. And if you are using an ASP.NET control you will need to figure > > out that ID since the ClientID is what is actually used in the HTML. > > > > You could just shorten the ClientID. > > > > http://blog.danbartels.com/archive/2005/11/11/1110.aspx > > > > What I have done to always know the value of the ClientID is to call > > RegisterScriptBlock with Javascript created to set to the value of the > > ClientID which can then be used in a static Javascript function. > > > > In my example you can use much of the code without making changes. The > > Javascript/DOM code should look very similar for your solution. > > > > Brennan Stehling > > http://brennan.offwhite.net/blog/ > > > > Midway wrote: > > > The Hyperlink that is invoking the Calendar control is; > > > javascript:calendar_window=window.open('calendar.aspx?formname=NewEmployeeform.TextBox4','calendar_window', 'width=350,height=290');calendar_window.focus() > > > > > > The TextBox4 is a control outside the detailsview. what I was trying was to > > > get that date to this TextBox4 control and pass that date to the TextBox > > > within the Detailsview, I was able to do that but I need a post back to the > > > server so the date shows up in the TextBox control within the Detailsview, > > > but in order to get a post back to the server I need to clink on a button, > > > that is not gonna work on the user interface. > > > > > > User should be able to just to click on that date and date should be > > > inserted with the Date field in the details view no more actions done. > > > > > > > > > Thanks for your help. > > > > > > Manny > > > > > > > > > "offwh***@gmail.com" wrote: > > > > > > > Can you post a little code or explain what you have tried so far? > > > > > > > > Brennan Stehling > > > > http://brennan.offwhite.net/blog/ > > > > > > > > Midway wrote: > > > > > Hi guys, > > > > > > > > > > This is what I'm doing, have a calendar control that I'm invoking from an > > > > > hyperlink. the calendar control has some javascript code that when I pick a > > > > > date, the date gets transffered to a text control on the calling form, that > > > > > is all work working fine. > > > > > > > > > > Now here's the chanllenge that I'm just really stuck. I want to get that > > > > > date from the calendar control to a text box within a Detailsview control. I > > > > > have been trying so many things but nothing seems to work. > > > > > > > > > > Please some ideas on how I can do this PLEASEEEE. > > > > > > > > > > Thanks so much. > > > > > > > > > > Manny > > > > > > > > > > > >
Need some advice on a GridView control.
Events for programatically added controls UserControl values lost on PostBack Menu control. Clickable area Custom Server Controls and javascript Exposing an event handler as a control property CustomWeb Controls and Events I want to know what is a Functional Specification Document? Clikable rows in Grid View Custom Collection Property Persistence |
|||||||||||||||||||||||