SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I bring a value to SharePoint Dialog to bind data. I call the dialog like this

<input type="button" value="<%#((DataRowView)Container.DataItem)["Id"] %>"   onclick="javascript:Open()" />

The script

<script type="text/javascript">
    //User Defined Function to Open Dialog Framework
    function Open() {

        var strPageURL = '<%= ResolveClientUrl("~/View.aspx") %>';
        OpenCustomDialogWithRefresh(strPageURL, 650, 400, "Add Document Type");
        return true;


function OpenCustomDialogWithRefresh(dialogUrl, dialogWidth, dialogHeight, dialogTitle, dialogAllowMaximize, dialogShowClose) {

var options = {
    url: dialogUrl,
    allowMaximize: dialogAllowMaximize,
    showClose: dialogShowClose,
    width: dialogWidth,
    height: dialogHeight,
    title: dialogTitle,
    dialogReturnValueCallback: Function.createDelegate(null, CloseCallback4)

I don't know how to bring the Id value to the View.aspx.

share|improve this question

You can pass it as a parameter to Open() function and then to OpenCustomDialogWithRefresh() function. You can pass it on as a query string parameter like:

strPageURL = strPageURL + '?id=" + idParam

You can access the query string parameter in View.aspx.

You can also pass it as args property of your options. Check this article:

share|improve this answer

Refer to this blog

Provide args to options which you pass to ShowModalDialog function. Then in modal dialog just retrieve the args through window.frameElement.dialogArgs You can pass simple values and whole objects.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.