c# - a little complex Linq2SQl insert operation (Dynamic user control and page insertion) -
I'm actually trying to do this, but I've been unable to find a way.
Here in the scenario, I got a blog module designed for my customers, because it is a repetitive task, so all I have to do is upload it just to the new customer and start blogging But some customers need additional custom fields, let's say they want to add a phone number for each article writer or additional reference, but I want to add it to each Do not apply to Rahk because it is a custom requirement.
Now for me to do this, this additional file was filed in user control and to create a dynamic user control with this code
blog bl = new blog (); Bl.ExtraRefrence = "http://www.something.com"; Load it into the blog management panel, but what do I want is that user controls have the ability to use the data reference in the main blog editing page, what do I mean in the main page If there is an inclusion command, then how do I see the main page entry command without creating dynamic user control value in 2 blog objects in the page and without user control.
Sorry, if I'm not clear, but seriously it killed me.
option 1
field is configurable.
Phony Code:
If Client HasExtraReference () then & lt; Asp: label text = "& lt;% = client.ExtrareferenceLabel%>" / & Gt; & Lt; Asp: textbox id = "txtExtrareference" /> End if and code-behind
blog bl = new blog (); Bl.Content = ... .... if the client. HesExtraReference () then bl.ExtraRefrence = txtExtraReference.text; HasExtraReference method lets you see some configs.
Option 2
If there are many additional and variable numbers in the field you can add an ExtraBlogItem table.
BlogExtraItem ------------- BlogExtraItemID int BlogID int Item Name Varchar (50) ItemValue Varchar (250) You Add desired items to the page, and then send a uniform list (BlogExtraItem's) parameter to the blog. Insert Function
Comments
Post a Comment