I using Full Calendar within a MS Access Form web browser control. Both Full Calendar and Access load events from the same MySQL database. This provides a drag and drop facility within Access.
I can pass the event title to Access using the InnerText property but event titles are not unique and therefore cannot be used to retrieve the event record in Access.
Using InnerHTML and OuterHTML I can capture the entire DIV
Whilst I could make the event title unique by adding the event id I'd prefer to modify the InnerHTML written by Full Calendar to include the event id as an HTML Id which I could then extract.
Is this possible and if so can someone suggest how ? Thanks.
I've solved the problem by using the className property of the Full Calendar Event object. I assign a class name equal to the id and this then appears in the HTML.
wbbControl.Document.activeElement.parentElement.outerhtml grabs the HTML for the parent of the selected item DIV. (wbbControl is the Access Web Browser Control).
Related
I would like to direct a user to a page within an app using a field value from a model. The model is loaded into a grid and the user makes a selection to navigate to a page within the app based on images displayed in the grid cells.
I am thinking to use the app.showPage(app.pages.Page) for the onClick event and passing in the page the user should be directed from the model as a parameter such as widget.datasource.item.PageName.
Can you suggest how the name of the page could be passed in from the datasource as as variable to the onClick event accomplish this navigation?
Will appreciate any help!
Lets say you are storing your page names in your datasource under a field PageName (string field) such as YourPageName1, YourPageName2, etc. Then for your onClick event all you would need is:
app.showPage(app.pages[widget.datasource.item.PageName]);
Where can I find the complete list of attributes for a control? If I wanted to use textbox control on my asp.net application, where can I find the complete list of attributes associated with it? I know some of the them can be found in the properties area in the IDE. But the properties area did not have the "OnTextChanged" attribute listed.
When you click on a web control, if you have the properties window open, then you will see it's properties, which contain the attributes of a web control. Another way is to click on the control and the right click and select properties.
By the way the OnTextChanged is an event, which you can associate it with a method, when this event happens.
OnTextChange="TextBoxText_Changed"
The TextBoxText_Changed would be a server side method, which will reside in your code behind class. In this method you will declare, what you want to happen, when this event is triggered,
![Properties][1]
[1]: http://i.stack.imgur.com/iUUqZ.png
go to property window click on event icon and you can see all events associated to text box.
You can look it up on the MSDN documentation page:
http://msdn.microsoft.com/en-us/library/System.Web.UI.WebControls.TextBox(v=vs.110).aspx
I have a markup for generating a list of clients and contacts info for each client. So, I am using nested list view control controls for displaying this. The outer listview control item template has a Image button, when clicked should open a popup extender so that I can attach new contacts to the client.
The problem is, in popup extender the target control id is set for the Image button above and I am getting a runtime error Unable to find the target control ID. Here is the markup...
Explicitly specifying the server event name in the markup of control event would solve this issue. Also the event should be marked as protected/public.
I have an ASP.NET page where I am dynamically building LinkButton and TextBox elements. These elements are being built during the OnInit event of the page. The user can then perform an action that changes the values of these elements. The values of these elements are changed via JavaScript. When the user clicks a button, a server-side event is fired. This event parses the value in each control. I have noticed that the value for the TextBox is correct, but the value for the LinkButton is not.
Can only certain types of controls in ASP.NET be dynamically generated and have their values retrieved on the server side?
Thank you.
You can't get value of link button at server side. You can only get form elements' values at server side.
If you want to pass more values to server side, you can use hidden input elements.
No, generally you can create whatever element you like, given you create it inside the OnInit event or if you add the INamingContainer (marker) interface, you should override the CreateChildControls() method and create your elements in there.
But what do you mean by changing the value of the LinkButton via JavaScript? What exactly do you change on the LinkButton?? Could you provide more details?
Ensure that the "runat=server" property is set for each form element you want to retrieve via server code, and that you have an ID associated with each.
The textbox is working because value of the textbox is actually sent in the postback. But the linkbutton doesn't send anything back to the server. If you need to send something back that gets changed on the client, you'd need to set a hidden field and then modify your linkbutton using that value.
This is what I'm doing: Using jquery, I'm popping up a "form" over the page that lets the user search for branches of the company and select the one they want. When the form pops up, they can type in a textbox, and it will do AJAX requests back to the server to return the top n results for what they've entered, and those results will be put into a list for them. I want the user to be able to select one by clicking a link that says "select" or something, and at that point I want it to do a PostBack have the Branch Selector control that this is in change it's SelectedBranch property to the newly selected branch. I've got this all working right now with a hard coded list of LinkButtons, but how do I do the same thing with a dynamic list of links inserted with jquery?
Look at the HTML that gets emitted for your hard coded LinkButtons. You'll see that each one calls the JavaScript __doPostBack function when clicked. I believe this function takes two arguments: a control ID and an extra command argument you can use for your own purposes.
I would suggest adding a single control to the page whose only job is handling events for the dynamic links. Then, when you are creating the links with jquery, make each one call __doPostBack, passing the event handling control's ID for the first argument and some other string for the second argument that identifies which link was clicked. In the Click event for the handling control, look at the second argument value and do what you need to do.
The short answer is... you don't.
ASP.NET relies on the Viewstate for the current state of the controls, including items in a DropDownList or similar control. Dynamically updating a list on the client will not modify the viewstate, so will not be available on the back end.
The general workaround for this is to just add a hidden field which updates/stores the current selection via js on the client side. Then read it from this field on the backend rather than List.SelectedValue.