Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
i created a document type "ABC" and i added tab for that as "Aboutustext" and i created one property called
"Aboutustext" under "Aboutustext"(my tab and property names are same)..
for that "ABC" doucment i got relative template name "ABC" in that i added textfield (below is code)
<umbraco:Item field="Aboutustext" runat="server"></umbraco:Item>
My Question is i want to access this item at server side and i want to know how to make visible true and false
i searched on net but i didnt get any library if you provide link for propreties available under <umbraco:Item> tag
it is so help full for me
tanks in advance.
Moved topic as it wasn't a forum bug...
If you need to get hold of a document info in .net code, use
umbraco.presentation.nodeFactory
class
So, if you know the id of the node, use
umbraco.presentation.nodeFactory.Node currentNode = new umbraco.presentation.nodeFactory.Node(1234);
or, if you don't know the specific id
umbraco.presentation.nodeFactory.Node currentNode = umbraco.presentation.nodeFactory.Node.GetCurrent();
umbraco.presentation.nodeFactory.Node currentNode = umbraco.presentation.nodeFactory.Node.GetCurrent(); string property = currentNode.(g)GetProperty("propertyAlias");
I think you'll need that last line to be
string property = currentNode.GetProperty("propertyAlias").Value;
otherwise it won't compile - and it's an uppercase G :)
I tried this and it worked.
<umbraco:Item field="header" runat="server" visible="false" ID="uiheader"></umbraco:Item>
protected void Page_Load(object sender, EventArgs e)
{
uiheader.Visible = true;
}
Everytime the page loads it will make the Item visible.
Hope this works.
Dan
danielcruger.com
Ha, nice addition Dan, haven't used it like that before, but seems very efficient, thanks for sharing.
Cheers,
/Dirk
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Accessing umbraco fields at server side
i created a document type "ABC" and i added tab for that as "Aboutustext" and i created one property called
"Aboutustext" under "Aboutustext"(my tab and property names are same)..
for that "ABC" doucment i got relative template name "ABC" in that i added textfield (below is code)
<umbraco:Item field="Aboutustext" runat="server"></umbraco:Item>
My Question is i want to access this item at server side and i want to know how to make visible true and false
i searched on net but i didnt get any library if you provide link for propreties available under <umbraco:Item> tag
it is so help full for me
tanks in advance.
Moved topic as it wasn't a forum bug...
If you need to get hold of a document info in .net code, use
class
So, if you know the id of the node, use
or, if you don't know the specific id
I think you'll need that last line to be
otherwise it won't compile - and it's an uppercase G :)
I tried this and it worked.
<umbraco:Item field="header" runat="server" visible="false" ID="uiheader"></umbraco:Item>
protected void Page_Load(object sender, EventArgs e)
{
uiheader.Visible = true;
}
Everytime the page loads it will make the Item visible.
Hope this works.
Dan
danielcruger.com
Ha, nice addition Dan, haven't used it like that before, but seems very efficient, thanks for sharing.
Cheers,
/Dirk
is working on a reply...