Hi
I have a index page the renders objects from my database as a treeview, each item has a link href="/MessageGroupType/Edit/1002 that makes an Ajax call to display a partial view in a DIV.
Within the partial view there is a delete button which calls my controller to delete the item.
However, i do a check to make sure the item can be deleted, if the item cant be deleted then i wish a pop-up to appear back on the edit form telling the user they cant delete this record.
In my Edit partial view i have the following code
<asp:PlaceHolder runat="server">
<script src="<%= Url.Content("../../Scripts/JQuery/jquery-1.4.1.min.js") %>" type="text/javascript">
</script>
</asp:PlaceHolder>
<script type="text/javascript" >
$(function() {
$("#dialog").dialog();
});
</script>
<% if (Boolean.Parse(ViewData["DisplayWindow"].ToString())){%>
<div id="dialog" title="Cannot Delete Message Group Type">
<p>This Mesage group Type Cannot be deleted as is linked to other message group Types </p>
</div>
<% }%>
So my main questions are
- Can i make a reference to a javascript script within my Partial View (i dont want my master page to be called on the partial view)
- When i dynamically load the partial view data into my DIV - can i then after calling my controller insert another DIV into the first DIV.
- I am i doing this the wrong way - so any pointers is appreciated
Cheers