how to create sub events in full calendar? - fullcalendar

I have a question about how I could add sub events at a specific time this way.
What path could I take to solve this?
First of all, Thanks.

Related

Xamarin.Forms - Page PopAsync pass parameters

I am looking for solution to pass parameters from the current page to a previous page and way how to check that the page was popped from another page in Xamarin.Forms.
Thanks !
To pass information from one page to another you can either use events or MessagingCenter: https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/messaging-center.
As a personal suggestion, I would try events first, if you cant achieve whatever you want with plain events, then you should give a look to MessagingCenter.
But as a TL;DR, the MessagingCenter allows components/viewmodels to communicate without knowing anything about each other.

What is the right way to handle mode parameters in MVC?

My app has a number of ambient properties, like the current CountryId, DocumentMode, etc. As I learned in a previous question, the current value of these properties should not be stored in the Session, but rather sent in the query string on every page request. So far so good.
So when I build a page, I want to arrange that all the action links look like this:
/controller/action?CountryId=x&DocumentMode=y&...
I can easily do this by checking the query string and slipping in the current value of each of these variables.
The question is, what's the right way to notify the app when one of the values changes?
Specifically, at the top of each view, I have a select dropdown that shows, e.g., all the countries. What should happen when you select a new one?
Right now, the change triggers a javascript function call that replaces the CountryId in the query string, and calls an action that just reloads the original page, but with the new CountryId set, and so the new action links are rebuilt. But this seems sort of kludgy. Is there a more elegant way to just update all the links on the page without needing a server refresh to do this? (I could always cook up some script to do this, but it doesn't seem trivial, and I don't want to reinvent the wheel if there's a built in way to do this.)
Any help much appreciated. Thanks!
You could put the part of the page that changes in a partial view and reload that view via AJAX each time a control is changed.
Partial rendering after page loaded
Alternatively you could just write some javascript to update all the links. Post some code and I'm sure you'll get some suggestions on a good way to write it.
I decided to keep things simple for the time being and just refresh the whole page, which recreates all of the links. My app is low volume and this suffices for now. If I ever need to build an app where the server can't be foolishly stressed like that, I'll see about the swap-in-place solution.

VB.NET if button1 caused post back then

I have a situation where I need to ignore parts of page load sub inside a isPostback = true. Basically inside the isPostBack I want something like if button1 caused postback.... do this else do this...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If IsPostBack = True Then
If TextBox1.Text <> String.Empty Then
CheckDate()
End If
End If
End Sub
I think what you need is the reference to the control name which triggered the postback.
http://geekswithblogs.net/mahesh/archive/2006/06/27/83264.aspx
Implement the solution which is there in the above link (Got it from here.... How to Get Source of postback)
If the control name is your button then do not do what needs to be done upon postback.
HTH
You should probably not have all this going on inside the Page_Load event. Instead, you should be handling events for each control that can cause a postback. This helps with code clarity, and ease of maintenance, not to mention better control in the first place.
Here's a nice brief blog entry I found on the subject: http://www.sitepoint.com/blogs/2007/01/21/page_load-is-evil/
Incidentally, handling events is much different in ASP.NET than in other environments, My guess, just based on the fact that you're trying to accomplish this in the Page_Load event is that you're not yet "getting" the event-driven programming model. (If I'm wrong, I apologize, I don't mean to be insulting).
If I'm right, however, once you get used to it, it's going to be a lot simpler for you than things were in the classic ASP days, for example, where you had to do things like try to figure out which button was clicked. Here's another nice article to explain this further: http://articles.sitepoint.com/article/driven-asp-net-development-c
It's hard to see this as a good idea. From the short snippet you posted, it looks like what you really need is a Validation control attached to your textbox.
Have a look at the POSTed items. You should see some sort of reference to that button in there. IIRC, if it was clicked, you will see some sort of reference in there, and if it wasn't it wouldn't be in there.
I had this same problem a while a ago and that's how I circumvented loading some stuff.

Modify Page Head in User Control

How can I modify the head portion of a page from within an embeded user control? I know I can have the control run in the head portion of the .aspx page but I have a existing site with numerous pages that I don't want to change. One thing they all have in common is the menubar.ascx. So, I figured I could put the code there to modify the head element of the containing page, but no dice. The code I am trying to implement looks like this, however, the Page.Header is null.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim favicon As New HtmlLink
favicon.Attributes.Add("REL", "SHORTCUT ICON")
favicon.Attributes.Add("HREF", "images/bh_favicon.ico")
Page.Header.Controls.Add(favicon)
End Sub
I tried putting it in the PreRender and the Render events but same thing. The Page.Parent.Page.Header is null too. Is there a better way to do what I want to do? Utlimately I want to add a favicon to a group of pages that is different from the default favicon. Basically I have two sites on in the same code base.
Be nice, this is my first post.
TIA
You may need to make your Page Head run at server, so the usercontrol can see it.
eg:
<head runat="server">
Which I guess sort of defeats the point if this isn't already done on all your pages. Maybe a solution wide RegEx search/replace would be in order to implement this.
Thanks for your answers. I know I was asking for the least amount of work solution, however, I want to make the code easy for me to manage. I think what I am going to do is construct a master page as a template for all pages (like #devstuff suggested). Then I am going to change the existing pages, about 50 pages, to use the master page. That way if something like this pops in the future I can easily change everything in one place.
Thanks for you help!
As mentioned by #Program.X you may need a full search/replace. If you are going to do that you might want to go one step further and use a Master page, but it really depends on your time constraints and how many pages there are to modify.

ASP.net: How to handle events from dynamically added controls?

So I have a number of user control dynamically added to a page, and user interaction with these dynamically added user controls need to be handled by the control's parent.
Is this what is referred to as "event bubbling"?
How do I do that in VB?
Thanks in advance.
First, you have several complex issues here and my initial thought is that you should separate them and attack each on its own until you have it working and then add them into the final solution. For instance, don't try to start off by dynamically creating your user control and getting it to expose and fire an event. The dynamic part of this problem could get in the way and cause your events not to work but you would never know which is the problem. Instead my recommendation is you focus on events in VB.NET and getting them to work from a statically created user control. Then once you have this all working, move to making the user control dynamically created.
As far as understanding events in VB.NET, I highly recommend the MSDN samples. Start with this simple example: How to: Raise an Event (Visual Basic) and then follow through with the other samples that are linked to from that page. Then once you have learned creating your own events in VB.NET, then look into adding a usercontrol dynamically.
Event bubbling is when a parent control handles an event from a child. So, yes, this is what you are trying to do.
I am not sure of VB but in c# you can use following
id.event+=eventhandler yourEvent;
My first response to this kind of question is always this - why are you dynamically adding the controls? Could they go into a repeater (where this becomes a lot simpler), or must they be programatically handled?

Resources