Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) ASP.net Error while saving file (Read 12005 times)
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
ASP.net Error while saving file
Oct 27th, 2009 at 9:28pm
Print Post  
Please suggest how to fix this error. We could not save the file in any directory. we tried giving IIS write permission and ASP.NET write permission.
here is the error we get
-------------
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
-------------

Thanks!!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ASP.net Error while saving file
Reply #1 - Oct 28th, 2009 at 7:14am
Print Post  
Hi,

You should give ASPNET write permissions for any existing files that you need to overwrite from code-behind, and you must also do that for the directory that contains the files, possibly with a "list folder  contents" permission enabled too.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
Re: ASP.net Error while saving file
Reply #2 - Oct 28th, 2009 at 2:46pm
Print Post  
Diagram seems to be saving for the first time but adding more shapes and saving it again is not working. Please suggest.
Thanks in advance..
Code
Select All
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        tbFileName.Value = Request.QueryString["layoutid"];


        //Load Already Existing Diagram

        string fileName =  tbFileName.Value;
        string localDir = MapPath(@"..\..\..\UserData\FMPLayout\");
        string FileLoc = localDir + fileName + ".xml";

        if(File.Exists(FileLoc))
        {
            diagramView.Diagram.LoadFromFile(FileLoc);
            //diagramView.Diagram.LoadFromFile(FileLoc);
        }
    }

    protected void btnSave_Click(object sender, EventArgs e)
    {

            string fileName = tbFileName.Value;
            string localDir = MapPath(@"..\..\..\UserData\FMPLayout\");
            string FileLoc = localDir + fileName + ".xml";


            //File.Delete(FileLoc);

            diagramView.Diagram.SaveToXml(FileLoc);
            //diagramView.Diagram.SaveToFile(FileLoc,false);

    }
} 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ASP.net Error while saving file
Reply #3 - Oct 28th, 2009 at 3:51pm
Print Post  
Do you mean you are seeing the permission error when saving for the second time?
  
Back to top
 
IP Logged
 
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
Re: ASP.net Error while saving file
Reply #4 - Oct 28th, 2009 at 3:56pm
Print Post  

it is not overriding

that means

if  you save one diagram for first time it is saving.but if you add some nodes and save it ..it is giving the firstsaved diagram.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ASP.net Error while saving file
Reply #5 - Oct 28th, 2009 at 4:05pm
Print Post  
Perhaps it's first loading the old diagram from the Page_Load handler? Try moving that code into an if (!IsPostBack) block, so that the existing file is loaded only upon the initial page load.
  
Back to top
 
IP Logged
 
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
Re: ASP.net Error while saving file
Reply #6 - Oct 29th, 2009 at 3:31pm
Print Post  
Thanks stoyon, it's working great.

i have one more question

is it possible to provide colors  for nodes in  cilent side.

that means users can fill any color in node what they want(visio have this feature)

can we have that feature.if yes can you provide sample code or example



Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ASP.net Error while saving file
Reply #7 - Oct 29th, 2009 at 4:04pm
Print Post  
Hi,

It's possible:

var applet = <%= diagView.AppletElement %>;
var scriptHelper = applet.getScriptHelper();
node.setBrush(scriptHelper.createSolidBrush(r,g,b));

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
Re: ASP.net Error while saving file
Reply #8 - Oct 29th, 2009 at 6:07pm
Print Post  
Hi
I want to use some more features but i dont know how can i use
1.http://mindfusion.eu/demos/jdiagram/start.htm.

in this link we have one link like half circle(not straight).hoe can i achive this?


2.http://mindfusion.eu/demos/jdiagram/Grouping.htm

how can i group nodes

3.http://mindfusion.eu/demos/jdiagram/Overview.htm

in this if you select a node you will get facility to rotate that node..

how can i achive this

4.how we can lock the node

i am using net diagraming flowcharter example javaapplet is my clinetside


can you give anysample code for all these
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ASP.net Error while saving file
Reply #9 - Oct 29th, 2009 at 7:30pm
Print Post  
Hi,

1. Set the link's Style property to Bezier. If you are doing that on the client, call link.setStyle(0).

2. Use the AttachTo() method.

3. node.EnabledHandles = AdjustmentHandles.All.

4. Enable its Locked property.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
Re: ASP.net Error while saving file
Reply #10 - Oct 30th, 2009 at 1:27pm
Print Post  
Hi you gave me this
Hi,

It's possible:

var applet = <%= diagView.AppletElement %>; 
var scriptHelper = applet.getScriptHelper(); 
node.setBrush(scriptHelper.createSolidBrush(r,g,b));

I hope that helps,
Stoyan



..but can.you tell me in which event i have to call this
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ASP.net Error while saving file
Reply #11 - Oct 30th, 2009 at 3:41pm
Print Post  
I suppose you will call this from the onclick handler of a button or onchange of a select element that applies the new color. In such case, you could first set node = applet.getDiagram().getActiveItem().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
Re: ASP.net Error while saving file
Reply #12 - Oct 30th, 2009 at 4:48pm
Print Post  
Thanks stoyo
it's working

one more question


+ args.getLink().getOrigin().getTag()
this will give id of a previous node .
i wnat to get both nodes id

how can i get ?


Thanks in advance
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ASP.net Error while saving file
Reply #13 - Oct 30th, 2009 at 5:06pm
Print Post  
Try with args.getLink().getDestination().getTag().
  
Back to top
 
IP Logged
 
learner123
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 20
Joined: Oct 9th, 2009
Re: ASP.net Error while saving file
Reply #14 - Nov 2nd, 2009 at 1:11am
Print Post  
Hi Stoyo

iam using this code ..
Code
Select All
function funNode_ChangeText()
{
var sNodeEdit = document.getElementById('txtNodeEdit').value;


    var applet = <%= diagramView.AppletElement %>;
    var node = applet.getDiagram().getActiveItem();
    //node.setText("Enter Text!");
	node.setText(sNodeEdit);
    <%=diagramView.AppletElement%>.getDiagramView().beginEdit(node);



}

function funNode_ChangeColor()
{
    var sColor = document.getElementById('colorpicker').value;
    var applet = <%= diagramView.AppletElement %>;
    var scriptHelper = applet.getScriptHelper();
    var node = applet.getDiagram().getActiveItem();
    if (node !=  null)
    {
	  var r,b,g;
	  r = sColor.substring(0,2);
	  g = sColor.substring(2,4);
	  b = sColor.substring(4,6);
	  node.setBrush(scriptHelper.createSolidBrush(h2d(r), h2d(g), h2d(b)));
    }
} 



it is working like this:

when you select node  then enter the text in text box that will display in node.. upto here i am fine.

but
here my requirement is whenever i select the node again it should dispaly the text(node have text) in textbox .

how can i achive this
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint