question

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 asked YijingSun-MSFT commented

Modal message issue

Hi,
Where to put Modal title below?

                      Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "ShowMessage('My message');", true);

How to remove Save changes button below?

135183-6b.png


dotnet-aspnet-generaldotnet-aspnet-webforms
6b.png (5.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YijingSun-MSFT avatar image
0 Votes"
YijingSun-MSFT answered YijingSun-MSFT commented

Hi @Jackson1990-7147 ,
How do you write your modal? If you used bootstrap modal or jquery modal,you could remove the save button.Just like this:

  <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog"
                 aria-labelledby="myModalLabel" aria-hidden="true">
                 <div class="modal-dialog">
                     <div class="modal-content">
                         <div class="modal-header">
                             <button type="button" class="close"
                                 data-dismiss="modal" aria-hidden="true">
                                 &times;
                             </button>
                             <h4 class="modal-title" id="myModalLabel">title
                             </h4>
                         </div>
                         <div class="modal-body">
                            
                         </div>
                         <div class="modal-footer">
                             <button type="button" class="btn btn-default"
                                 data-dismiss="modal">
                                 close
                             </button>
    
                             //remove this button
                             <button type="button" class="btn btn-primary">
                                 save
                             </button>
                         </div>
                     </div>
                     <!-- /.modal-content -->
                 </div>
             </div>

Best regards,
Yijing Sun


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I put your current code but I've got prompt below. How to input one proper title? How to remove Save button?
135379-5h.png


0 Votes 0 ·
5h.png (8.1 KiB)

Hi @Jackson1990-7147 ,

How to input one proper title?

You need to write your title in these lines:

 <h4 class="modal-title" id="myModalLabel">your title 
 </h4>

How to remove Save button?

I said you need to delete the save button. You need to delete these lines:

 <button type="button" class="btn btn-primary">
                                  save
                              </button>

You could compare these code which you need to change or delete with below codes my posted.

Best regards,
Yijing Sun

0 Votes 0 ·

How to show other text on close button?

0 Votes 0 ·

How to also center the button within the prompt popup?

0 Votes 0 ·
Show more comments
Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 answered YijingSun-MSFT commented

Please see the code within css file below. Yes, I expect OK button to be centered within the Modal. Where to adjust it?
136210-6e.png



6e.png (4.5 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Jackson1990-7147 ,
Since you can't open your project, I tried part of your modal codes. I suggest you could delete the style of "display:inline-block !important;". Just like this:

  <style>
         .modal-footer {
             display:inline-block !important; 
             text-align:center;
         }
     </style>

Result:
136478-capture5.png

Best regards,
Yijing Sun

0 Votes 0 ·
capture5.png (4.5 KiB)

I have the same codes within StyleSheet1.css and why OK button is not centered, when running the re-deployed project?

0 Votes 0 ·

Hi @Jackson1990-7147 ,
I mean that you need to delete the codes of "display:inline-block !important;".

  <style>
         .modal-footer {
             /*display:inline-block !important;*/ /*remove this line!*/
             text-align:center;
         }
     </style>

You have a difference of the div structure with me. You have many things and I only have a modal sample. I couldn't complete your codes. So, you must to learn how to check the css problem by yourself. You could press F12 and in the "Elements",you could check your controls and their css styles.

0 Votes 0 ·