Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to show notification as a pop up. like when admin login and through his account he send notification to user. i have added this html in admin form like this..


ASP.NET
<asp:Button ID="notic" runat="server" Text="Send" onclick="Button1_Click" /> <br />

          <input class="add_message" type="text" value="type your message"
          name="add_message"></input>
  <input type="button" value="add message"  
         önclick="sNotify.addToQueue($('.add_message').attr('value'))"/>


Then when admin click on button then notification send to users account like when any user login then he/she able to see pop ups in user form I call this java script in user form page load like this ..

C#
ClientScript.RegisterStartupScript(GetType(), "Javascript",
         "javascript:sNotify.addToQueue($('.add_message').attr('value'))();", true);



it works like when i login as an admin and click on button then notification in his own page .. but i want to show this notifications in userform.

so how can i get this??
Posted
Comments
Vishal Pand3y 13-Nov-13 6:12am    
You can use a div add runnat=server and set its visibility hidden and when you want to show it set its visibility show from client side
Diya Ayesa 13-Nov-13 7:10am    
in html?
Diya Ayesa 13-Nov-13 7:20am    
like this? ....
<div runat="server" id=hiddenn">

<asp:Button ID="notic" runat="server" Text="Send" onclick="Button1_Click" /> <br />

<input class="add_message" type="text" value="type your message"
name="add_message"></input>
<input type="button" value="add message"
önclick="sNotify.addToQueue($('.add_message').attr('value'))"/>

</div>
Vishal Pand3y 13-Nov-13 7:12am    
yes
Diya Ayesa 13-Nov-13 7:21am    
@Vishal Pand3y like this? ....

<div runat="server" id=hiddenn"> <asp:Button ID="notic" runat="server" Text="Send" onclick="Button1_Click" /> <br /> <input class="add_message" type="text" value="type your message" name="add_message"></input> <input type="button" value="add message" önclick="sNotify.addToQueue($('.add_message').attr('value'))"/> </div>

1 solution

HTML
<div id="Something" visible="false">
What Ever Message you Want to show...........
</div>

C#
//now From Server side Set Visiblility of div true
Something.visible=true;

Hope this Helps........
 
Share this answer
 
v2
Comments
Diya Ayesa 14-Nov-13 7:53am    
this is in user page?
Diya Ayesa 14-Nov-13 7:53am    
when i add this html in user page and call in page load then something not in list..
Vishal Pand3y 14-Nov-13 9:22am    
this div should be where you want to show message
and i just can't understand this 'call in page load then something not in list..'
Diya Ayesa 14-Nov-13 10:21am    
like this in call js in pageload .. ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript:sNotify.addToQueue($('.add_message').attr('value'))();", true);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900