1

i have a public function GetName()in an .ascx file:

<script language="C#" runat="server">
public string GetName()
{
     return name;
}

...

...

</script>

I have a file .aspx where im trying to call this GetName() function. how can i do that?

1 Answer 1

1

If your user control is part of the aspx page, you could do something like UserControlID.GetName() from the page.

If it's not, maybe you should consider moving the function to a class that's shared among files in your project.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.