移动班级的文本内容 [英] move the text content of the class

查看:57
本文介绍了移动班级的文本内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



这就是我在节目中工作的方式,以便我的用户,例如,他们在网站上传了一张照片。



我已经在我身边这样做了



Hello

this is how I work on the show so that my user, for example, they have upload a picture on the website.

I have done so here at my side

if (UploadSuccesBesked.UploadIndhold(1))
                {
                    PanelIndhold.Visible = true;
                    LiteralBesked.Text = "<div class='alert alert-success'><strong>Upload</strong> Succes du fik upload dit billede!</div>";
                }







我在这里的文字,我可以想象有在我的班上所以我只需要在某个地方改正它。但在我的班上我已经在这里完成了。






the text which I have right here, I could well imagine to have in my class so I only have to right it somewhere. but over in my class I have done so here.

int load = 3;
        if (succes == 1)
        {
            HttpContext.Current.Response.AddHeader("REFRESH", load + ";URL=?opdater=true");
            return true;
        }





这就是我想把这个文字内容订购到课堂上的方式。



知道我用丹麦语写过一些东西,但你可能会问,如果你不太明白我要去哪里?





EIDT:



我的班级





this is how I would like to order this text content into the class.

Know that I have written some things in Danish but you may ask into if you do not quite understand where I'm going?


EIDT:

My class

public class UploadSuccesBesked
{
    public static bool UploadIndhold(int succes)
    {
        int load = 3;
        if (succes == 2)
        {
//I would like to order this here text in here,
//"<div class='alert alert-success'>Upload Succes du fik opdater din adgangskode!</div>";
            HttpContext.Current.Response.AddHeader("REFRESH", load + ";URL=?opdater=true");
            return true;
        }
        else if (succes == 2)
        {
            HttpContext.Current.Response.AddHeader("REFRESH", load + ";URL=?opdater=false");
            return true;
        }
        //Det er hvis intet af det passer overhovedet!!
        return false;
    }
}

推荐答案

所以...让我们试着清除它...



你想拥有

So...lets try to clear this up...

You want to have
public class UploadSuccesBesked
{
public property string Messages;
}



然后在你的班级设置并在页面上显示......对吗?



目前尚不清楚这是MVC还是什么?



如果是,则消息成为模型的一部分,您只需刷新视图即可显示对话框(包含 @m.Message ...



如果这是ASP.NET那么你把消息添加到一些公共变量(或会话),在javascript中读取并调用showMessageDiv(已经在页面上,只是隐藏)



它会去(像这样):

CSS:


and then set that in your class and show on the page...right?

It is not clear if this is MVC or what?

If it is, then Message becomes part of the model and all you need is to refresh the view and show the dialog (which will contain @m.Message...

if this is ASP.NET then you add the message to some public variable (or Session), read it in javascript and call showMessageDiv (which is already on the page, just hidden)

it would go (something) like this:
CSS:

.hidden {display: none;}



HTML:


HTML:

<div id="msg-dialog" class="alert alert-success hidden">Upload <span id="msg"></span>/pre>

<pre lang="Javascript">


(#msg)。val(<% =您的服务器变量%>);
#(#msg-dialog)。show();
("#msg").val("<%=your server variable%>"); #("#msg-dialog").show();





您可以直接操作隐藏面板服务器端只需将 runat =server添加到 div


这篇关于移动班级的文本内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆